Dataset::SetText

Description

Set the text value of a cell in an Origin data set of type Text & Numeric.

Syntax

BOOL SetText( int nRow, LPCSTR lpcszTextValue )

Parameters

nRow
[input] Row number (O based offset) of an Origin data set whose text value is to be set
lpcszTextValue
[input] Text value to set

Return

Returns TRUE on successful exit and FALSE on failure.

Examples

EX1

void Dataset_SetText_ex1()
{
    // a Worksheet with at least 1 column must exist prior to execution and must have a column type of Text & Numeric
    string strTextVal;
    Worksheet wks;
    wks.Create("origin", CREATE_VISIBLE);
    if (wks)
    { 
        Dataset dsTextA(wks, 0);         // Attach to data set
        dsTextA.SetSize(3);
        for(int ii = 0; ii < 3; ii++)       // For rows 0 to 2...
        {
            strTextVal.Format("Row %d",ii); // Format text value
            dsTextA.SetText(ii,strTextVal); // Set text value of row ii
        }
    }
}

Remark

Set the text value of a cell in an Origin data set. The Origin data set must be of type Text & Numeric.

See Also

Dataset::GetText, Datasheet::SetCell, Worksheet::GetCell, Datasheet::Cell, Datasheet::TCell

header to Include

origin.h