Project::FindPage

Description

Find a Page object by name, can be short name or long name.

Syntax

Page FindPage( LPCSTR lpcszName, int nType = EXIST_WKS, int nAlsoCanbeType = EXIST_MATRIX, BOOL bAlsoCanbeLongName = true )

Parameters

lpcszName
[input]The name of the page, can be long name if bAlsoCanbeLongName is true
nType
[input] The type of page to look for, use EXIST_WKS, EXIST_MATRIX, etc, or 0 if any type
nAlsoCanbeType
[input] The Or condition when searching, must be -1 if nType is 0, and can never be 0
bAlsoCanbeLongName
[input] true if first match short name then match long name, false if only short name is check

Return

Returns a valid Page or an invalid Page object.

Examples

EX1

void Project_FindPage_EX()
{
    WorksheetPage wp; 
    wp.Create("Origin");//create a worksheetpage
    if( wp.IsValid() )   
        printf("%s Create successfully!\n",wp.GetName());
    else
    {
        printf("wp cann't create.\n");  
        return ;
    }        
    
    Page wp2 = Project.FindPage(wp.GetName());
    
    if(wp2)
        printf("Find Page %s",wp2.GetName());

    return;
}

Remark

See Also

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

header to Include

origin.h