2.2.4.28.46 MatrixObject::SetNumCols

Description

Set the number of columns and keep same number of rows. Same as SetSize(GetNumRows(), nCols, OCD_RESTORE | OCD_INITDATA) so the resulting matrix will restore original data and there is no undo, also new cells will be filled with missing values

Syntax

BOOL SetNumCols( uint nCols )

Parameters

nCols
[input] Input number of columns to set, must be > 0

Return

Returns TRUE on successful exit and FALSE on failure.

Examples

EX1

// Set number of columns in a matrix to 100
// Requires active matrix window
void MatrixObject_SetNumCols_Ex1()
{
    MatrixLayer    ml = Project.ActiveLayer();
    if(ml)
    {
        BOOL bRet = ml.SetNumCols(100);
        printf("%u Columns\n", ml.GetNumCols());
    }
    else
        printf("Matrix window not active.\n");
}

Remark

See Also

MatrixObject::SetSize, MatrixObject::SetNumRows, MatrixObject::GetNumRows, MatrixObject::GetNumCols, Datasheet::GetNumRows, Datasheet::GetNumCols, Datasheet::SetNumRows

Header to Include

origin.h