2.2.4.32.44 OriginObject::SetLongName

Description

Sets the long name of an object

Syntax

BOOL SetLongName( LPCSTR lpcszLongName, BOOL bUpdateShortName = true, BOOL bUpdateDisplay = true )

Parameters

lpcszLongName
[input] pointer to the long name to set
bUpdateShortName
[input] true will also update the short name, false if not changing short name
bUpdateDisplay
[input] true will update display, false will not update, which might be faster if calling in a loop and to update later

Return

TRUE if OK. FALSE if object does not have long name support

Examples

EX1

// Standard, two-column worksheet should be active
void OriginObject_SetLongName_Ex1()
{
    Page pg = Project.Pages(); // Active workbook
    Worksheet wks = Project.ActiveLayer(); // Active worksheet
    Column col(wks, 1);
 
    pg.SetLongName("A workbook can have both Long and Short Names");
    string str = pg.GetLongName();
    out_str(str);
 
    col.SetLongName("A Column can have both Long and Short Names");
    str = col.GetLongName();
    out_str(str);
 
    // A worksheet Long Name was added in Origin 9.1
    string strLN = "Sheet Long Name supports more characters [some not allowed in Short Name]";
    BOOL bb = wks.SetLongName(strLN);
    str = wks.GetLongName();
 
    // A worksheet Short Name can include up to 31 characters
    // and can not include `!%|"<>()[]{ or }
    wks.SetName("Worksheet name can have 31 char");
    str = wks.GetName();
 
    pg.Refresh();
}

Remark

Sets the long name of an object that supports both long and short names

Only Column and Page objects support long name

See Also

OriginObject::GetLongName

Header to Include

origin.h