Project::MatrixPages

Description

Collection of all the matrix pages in the project.

 

Get a Matrix window by index.

 

Get a MatrixPage object by name.

Syntax

Collection<MatrixPage> MatrixPages

MatrixPage MatrixPages(int index)

MatrixPage MatrixPages(LPCSTR lpcszName)

Parameters

index
[input] The 0-offset index of the MatrixPage object in the open project.

lpcszName
[input] Name of the matrix page in Origin.

Return

Returns a valid MatrixPage object for the index'th MatrixPage object in the project or an invalid MatrixPage object.


Returns a valid MatrixPage object having the short name lpcszName or an invalid MatrixPage object.

Examples

EX1

// This example assumes several existing matrix windows
int Project_MatrixPages_ex1()
{
    // Loop over all the matrix pages in the project and display their names
    foreach(MatrixPage mp in Project.MatrixPages)
    {
        out_str(mp.GetName());
    }
    return 0;
}

EX2

// This example assumes at least one existing matrix window in Origin
int Project_MatrixPages_ex2()
{
        MatrixPage mp = Project.MatrixPages(0); // Get the first matrix page
        if( mp.IsValid() )
                out_str(mp.GetName()); // Display the name of the first created matrix page
        return 0;
}

EX3

// This example assumes at least one existing matrix window in Origin
int Project_MatrixPages_ex3(string strName = "MBook1")
{
        MatrixPage mp = Project.MatrixPages(strName); // Get the MatrixPage for the matrix window in Origin having the short name strName
        if( mp.IsValid() ) // If valid...
                out_str(mp.GetName()); // Use the MatrixPage object to display the name of the window
        return 0;
}

Remark

header to Include

origin.h

See Also

Project::Pages, Project::WorksheetPages, Project::Notes, Project::GraphPages, Project::LayoutPages, Project::LooseDatasetNames, Project::DatasetNames

Reference