"cellValueRC"

Defines the contents of a cell in a particular row and column.

Synopsis

1)

setValue(string shape, "cellValueRC", int n, string Name, <anytype> Contents);

getValue(string shape, "cellValueRC", int n, string Name, <anytype> &Contents);

shape.cellValueRC(int n, string Name [, <anytype> Contents]);

2)

setValue(string shape, "cellValueRC", int n, string Name, <dyn_anytype> formContents);

shape.cellValueRC(int n, string Name, <dyn_anytype> formContents);

Parameters

Parameter Description
shape Name of the object
n Line index, starting with 0
Name Column name
Contents Contents of the selected cell
formContents One-dimensional array with up to 3 fields. Can only be set.

Description

Allows editing the contents of a cell specified by a row and column. Remember that the index starts at 0. In a "formContents" call, the colors for the cell are passed in addition to the value using the following format:

[<anytype> Value <string> bCol <string> fCol].

Example

Writes a formatted value into the 3rd row of the "Name" column.

main()
{ 
  shape table=getShape("table234"); 
  dyn_string tmp;
  tmp[1]="Frank";
  // Contents
  tmp[2]="blue";
  // Background
  tmp[3]="red";
  // Foreground
  table.cellValueRC(2, "Name", tmp);
  // 3rd row
}

If a boolean value is set for a table cell, a check box is shown in the table cell. The following example shows a table with a check box as well as a combo box in a table cell. A combo box or a push button can be set with "cellWidgetRC".

main()
{ 
  TABLE1.appendLine("Column1", "Nationality: European");
  TABLE1.appendLine("Column2", "");
  bool val;
  TABLE1.cellValueRC(0,"Column2",val);
  TABLE1.cellWidgetRC(1, "Column2", "ComboBox", makeDynString(true, "English", "Austrian","German"));
}
Figure 1. Table including a Check Box and a Combo Box

Note that if a string should be shown, a bool element should be cast explicitly to string, for example, cellValueRC(...(string)true).

Assignment

Table