*SetCell()

Sets the properties of a cell in a form or a tableform.

Syntax

*SetCell(row, col, ds_var, 
                            fmt_str, 
                            LEFT|CENTER|RIGHT, 
                            EDIT|NO_EDIT)

Arguments

row
The row number of the cell.
Data type: integer
col
The column number of the cell.
Data type: integer
ds_var
The variable to be displayed in the cell specified by the row and col arguments.
Data type: user-defined
fmt_string
The format string for the cell.
Data type: string
LEFT CENTER RIGHT
This argument sets left, right, or center justification within the cell.
EDIT NO_EDIT
This argument determines whether or not the cell can be edited.

Example

*DefineForm(frmdef_vehpar, ds)
 *SetRowsCols(6, 5)
 *RowHeight(1, 2)
 *ColumnWidth(1, 20)
 *ColumnWidth(2, 7)
 *ColumnWidth(3, 4)
 *ColumnWidth(4, 20)
 *ColumnWidth(5, 7)
 *ColumnLabel(1, "Properties")
 *ColumnLabel(2, "Values")
 *ColumnLabel(4, "Properties")
 *ColumnLabel(5, "Values")
 *MergeCells(1, 3, 6, 3)
 *SetCell(2, 1, ds.wb.label, , Left, No_Edit)
 *SetCell(3, 1, ds.cf.label, , Left, No_Edit)
 *SetCell(4, 1, ds.br.label, , Left, No_Edit)
 *SetCell(5, 1, ds.tr.label, , Left, No_Edit)
 *SetCell(6, 1, ds.ar.label, , Left, No_Edit)
*EndDefine()

Context

*DefineForm()

*DefineTableForm()

Comments

The format string argument, fmt_string, specifies the display format for the data to be displayed. fmt_string can be used to specify the format for an object of type integer, real, string, boolean, ObjectReference, option, filename, or tableform.

Standard "C" formatting rules are used to display integer, real, or string data. Boolean data may be displayed as a toggle button by setting fmt_string to Toggle. To display a tableform in a cell, the ds_var argument specifies the variable name of the tableform and fmt_string is set to Form. Data of type filename and ObjectReference are displayed as a file browser and an entity collector.

If ds_var refers to an image file name, the image will be displayed to fit within the cell. Currently .png and .jpeg are supported. Animated gifs are not supported. Specify “NO_FIT” in fmt_string to display the image with the real size.

When used in a *DefineTableForm() block, the argument, ds_var, in the *SetCell() statement refers to a variable in the table without specifying the record index. Variables are automatically indexed as multiple records are displayed in the table form.