setCellText

setCellText(r:   Integer;
            c:   Integer;
            str: String);

The setCellText method of the Table class sets the text of the cell specified in the r and c parameters of the current sheet of a table.

This method does the same as the text property, except that you do not need to set the values of the row and column properties, as this method has no impact on the values of those properties.

The method in the following example shows the use of the setCellText method.

cdtable_rowColumnChg(table: Table input) updating;
vars
    indx, count : Integer;
begin
    if table.row = 1 and table.column > 1 then
        table.sortColumn[1] := table.column;
        table.resort;
        count := table.rows - 1;
        indx  := 1;
        while indx <= count do
            table.setCellText(indx + 1, 1, indx.String);
            indx := indx + 1;
        endwhile;
        table.row    := 1;
        table.column := 1;
        table.clearAllSelected;
    endif;
end;

The following code fragment shows the use of concatenation with the Tab character to store text in cells to the right of the specified cell.

// Set up the column headings
table.setCellText(1, 1, "Name" & Tab & "Address" & Tab & "Phone");

See also the getCellText method.