Column::Attach

Description

Attach the column object to a Worksheet column by worksheet name and column number


Attach the column object to a Worksheet column using a worksheet object and column number

Syntax

BOOL Attach( LPCSTR lpcszWksName, UINT iColNum )

BOOL Attach( Worksheet & wks, UINT iColNum )

Parameters

lpcszWksName
[input] name of the worksheet.
iColNum
[input] column number in the worksheet at which the column should be attached.

wks
[input] worksheet object.
iColNum
[input] column number in the worksheet at which the column should be attached.

Return

True for success; false otherwise


True for success; false otherwise

Examples

EX1

// Worksheet with at least one column must exist in  project
void Column_Attach_Ex1()
{
    Column colMy;
    WorksheetPage wp = Project.WorksheetPages(0);
    if(!wp)
        return;
    
    if( colMy.Attach(wp.GetName(), 0) )
        out_str("A column is attached to the first column of worksheet "+Project.WorksheetPages(0).GetName());
    else
        out_str("Attach error!");
}


EX2

// Worksheet with at least one column must exist in project
void Column_Attach_Ex2()
{
    WorksheetPage wp = Project.WorksheetPages(0);
    if(!wp)
        return;
    
    Worksheet wksMy(wp.GetName());
    Column colMy;
    if (colMy.Attach(wksMy, 0))
        out_str("A column is attached to the first column of worksheet "+Project.WorksheetPages(0).GetName());
    else
        out_str("Attach error!");
}

Remark

Attach the column object to a Worksheet column using a worksheet object and column number.

See Also

Datasheet::Attach,MatrixObject::Attach

header to Include

origin.h