Cell references have the form:
[integer|string|float|boolean]
cell
{column COL_ID of row ROWNUM
#OR
COL_ID, ROWNUM}
of TABLE_NAME
For example:
cell column Price of row (LastCar+1) of AutoLot cell column Make of row SelectIndex of AutoLot
in SellCarsDR
cell column 4 of row 4 of DataTable # These are
cell 4,4 of DataTable # equivalent
float cell column CurCol_SV of row 5 of AutoLot
Because the ESL language allows you to define objects either statically (at compile time) or dynamically (at runtime), you must understand how to use cell references to avoid compile-time and runtime warnings and errors.
In the following examples, EmpName is a statically defined column in the table EmpTable; Column_SV and Table_SV are string variables containing the names of a column and a table; and NewColumn and NewTable are constant names that are not defined in the source code, either because of an error or because they are dynamically defined.
A column or cell reference can be one of the following:
Defined reference, where column and table names are statically created; for example:
copy (cell column EmpName of row 1 of EmpTable)
to EmployeeName
ESL generates a warning if you specify in a cell reference the name of a table that is not defined (if you use the -warn switch when compiling).
Variable reference, which uses ESL variables for the column and/or table name; for example:
copy (integer cell column Column_SV of row 1
of Table_SV) to CurrentValue
(See Explicit Data Types for an explanation of why this example requires that you include the data type integer.) ESL generates a compile-time warning for any column/table reference in which the table identifier is a variable and the column identifier is not, and no column with that identifier exists in any table (if you use the -warn switch when compiling).
Undefined reference (neither of the above two types), where the column or table name is not defined at compile-time, either due to an error or a forward reference; for example:
copy (string cell column NewColumn row 1
of NewTable) to StringValue
ESL generates a compile-time warning for any column/table reference that contains an undefined column or table name at compile-time (if you use the -warn switch when compiling). ESL generates a runtime error for any column/table reference that contains an undefined column and/or table identifier at runtime.
In addition, note the following concerning cell references:
You can use a cell reference in the same places as expressions of that cell's data type.
You can use a cell reference as the destination for a copy statement, but not for an append or extract statement.