2.2.4.5.52 Column::SetLabel

Description

Set the column LongName.

Syntax

BOOL SetLabel( LPCSTR lpcstrLabel )

Parameters

lpcstrLabel
[input] pointer to a null-terminated string to be used as the column label

Return

TRUE if set the column label successfully, otherwise FALSE.

The error may simply be that Origin modified the name which is now in strColLabel.

Any more disastrous error should set the string to null.

Examples

EX1

// Worksheet with at least one column must exist in the project
void    Column_SetLabel_Ex1()
{
    WorksheetPage wp = Project.WorksheetPages(0);
    if(!wp)
        return;
    
    Worksheet wks(wp.GetName());
    string strLabel = "Time";
    BOOL b = wks.Columns(0).SetLabel(strLabel);
}

Remark

SetLabel is rarely used nowadays. It is replaced by SetLongName, SetUnits and SetComments.

See Also

Column::GetLabel, Column::SetLongName, Column::SetUnits, Column::SetComments

Header to Include

origin.h