2.2.4.32.24 OriginObject::GetName

Description

The short name of the Origin object, which can be a Column, a Layer, or a Page


Get the name of a worksheet or matrix layer

Syntax

string GetName( )


BOOL GetName( string & str )

Parameters

str
[output] String to receive name of worksheet layer

Return

Name of the Origin object, or the Short Name if object has both long and short names.


TRUE for success, FALSE if object does not have a name.

Examples

EX1

// Get the Short Name of the active window
void    OriginObject_GetName_Ex1()
{
    Page page = Project.Pages();
    if(page)
        printf("The active window's short name is %s\n", page.GetName());
}


EX2

int    OriginObject_GetName_Ex1()
{
    WorksheetPage wp = Project.WorksheetPages(0);
    
    if(!wp)
        return -1;
    
    Page        pg(wp.GetName());
    Layer        lay = pg.Layers();    // gets the active worksheet layer

    Worksheet wks = lay;
    if (wks)
    {
        string    strName;
        wks.GetName(strName);
        out_str(strName);
    }
    return 0;
}

Remark

Retrieves the name of a OriginObject.

See Also

OriginObject::SetName

Header to Include

origin.h