2.2.4.46.69 Worksheet::SetColDesignations

Description

Used to apply designation pattern to an entire worksheet

Syntax

BOOL SetColDesignations( LPCSTR lpcszDesignations, BOOL bRepeat = TRUE, int nC1 = 0, int nC2 = -1, DWORD dwDumpErr = 0 )

Parameters

lpcszDesignations
[input] designation pattern
Possible values for designations:
'X' - X column
'Y' - Y column
'Z' - Z column
'E' - Y error column
'L' - label column
'M' - X error column
'N' - ignore column
bRepeat
[input] Repeat pattern. Defines how the pattern is applied. if number of columns in worksheet is larger then length of pattern.
Possible values:TRUE - repeat entire pattern(by default)
FALSE - set designations for the rest of columns to be the last one defined by pattern
nC1
[input] start index to clear, default to 0 means from the first column
nC2
[input] end index to clear, default to -1 means to the end of column
dwDumpErr
[input] Dump error messages:
SETCOLDESIG_DUMP_FIND_Y_ERROR - dump error message when designations need at least one Y column

Return

TRUE for success. Otherwise FALSE;

Examples

EX1

// The following code will set column designations in worksheet
// in this pattern : X, Y, Label, Y, Label
// The pattern will repeat if worksheet contains more than 5 columns
void Worksheet_SetColDesignations_Ex1()
{
    Worksheet wks;
    wks.Create("Origin", CREATE_VISIBLE);
    for( int ii = 1 ; ii <= 8 ; ii++ ) 
        wks.AddCol();
    
    if( wks.SetColDesignations("XYLYL") )
        printf("Success to set designation pattern in worksheet!");
    else
        printf("Fail to set designation pattern!");
}

Remark

See Also

Worksheet::GetColDesignations, Column::GetType, Column::SetType

Header to Include

origin.h