Column::SetType

Description

Set the type designator of a column (X, Y, Z, YErr, XErr, L or disregard).

Syntax

BOOL SetType( int iType )

Parameters

iType
[input] the column type enum {
OKDATAOBJ_DESIGNATION_Y = 0,
OKDATAOBJ_DESIGNATION_NONE,
OKDATAOBJ_DESIGNATION_ERROR,
OKDATAOBJ_DESIGNATION_X,
OKDATAOBJ_DESIGNATION_L, // Label
OKDATAOBJ_DESIGNATION_Z,
OKDATAOBJ_DESIGNATION_X_ERROR};

Return

TRUE if set the column type successfully, FALSE otherwise.

Examples

EX1

// Create a worksheet with each type of column designation
void    Column_SetType_Ex1()
{
    Worksheet wks;
    wks.Create("Origin", CREATE_VISIBLE);
    wks.Columns(0).SetType(OKDATAOBJ_DESIGNATION_X); // An X column
    wks.AddCol();
    wks.Columns(2).SetType(OKDATAOBJ_DESIGNATION_Y); // A Y column
    // Note that sequence is forced by internal check that won't allow X Err without Y column in worksheet
    wks.Columns(1).SetType(OKDATAOBJ_DESIGNATION_X_ERROR); // An X Err column
    wks.AddCol();
    wks.Columns(3).SetType(OKDATAOBJ_DESIGNATION_ERROR);   // A Y Err column
    wks.AddCol();
    wks.Columns(4).SetType(OKDATAOBJ_DESIGNATION_L); // A Label column
    wks.AddCol();
    wks.Columns(5).SetType(OKDATAOBJ_DESIGNATION_Z); // A Z column
    wks.AddCol();
    wks.Columns(6).SetType(OKDATAOBJ_DESIGNATION_NONE); // A Disregard column
}

Remark

Set the type designator of a column (Y, disregard, Y Err, X, Label, Z or X Err).

See Also

Column::GetType

header to Include

origin.h