2.2.4.5.22 Column::GetName

Description

Get the column short name.

Syntax

int GetName( string & strName )

Parameters

strName
[output] reference to the string that will receive the name.

Return

The length of the name, 0 if none, -1 if error.

Examples

EX1

// Worksheet with at least one column must exist in project
void    Column_GetName_Ex1()
{
    WorksheetPage wp = Project.WorksheetPages(0);
    if(!wp)
        return;
    
    Worksheet wks(wp.GetName());
    string strName;
    for(int i = 0 ; i < wks.GetNumCols() ; i++)
    {
        wks.Columns(i).GetName(strName);
        printf("Column %u of %s is named %s\n", i+1, wks.GetName(), strName);
    }
}

Remark

Get the column short name.

See Also

Header to Include

origin.h