page_get_display_name

 

Description

get page name for display, get long name first, but if empty, then use short name

Syntax

string page_get_display_name( const PageBase & pg, bool bShortAndLongName = false )

Parameters

pg
[input] page to get name
bShortAndLongName
[input] false will just return long name if present or short name,if = true, then will check if long name present and different from short name, and if true, then generate "shortName - LongName"

Return

the long name of the page to get name if present, or the short name of the page.

Examples

EX1

//For this example to run, make sure the active window is a workbook
void page_get_display_name_ex( )
{
        Worksheet wks1=Project.ActiveLayer();       
        string strPg = page_get_display_name(wks1.GetPage());
        printf("%s\n",strPg);
}

EX2

//For this example to run, make sure the active window is a workbook
//first set the active workbook's longname to be different from shortname
void page_get_display_name_ex2( )
{
    Worksheet wks1=Project.ActiveLayer();   
    string strPg = page_get_display_name(wks1.GetPage(), true);
    printf("%s\n",strPg);
}

Remark

See Also

header to Include

origin.h

Reference