Row State and Record Values for Table Fields and Arrays
Each record in a table-field data set or array has an associated integer state value. You can reference the special constant _state to obtain this value for each record, or assign _state to a variable in an unloadtable statement. In addition, you can reference the special value _record to get the record's sequence number in the table field data set or array.
In a table field, _state indicates whether data in a data set record is Undefined, New, Unchanged, Changed, or Deleted. A record becomes Changed when the user types over it, or when its value is changed by a statement in the application.
By default, table-field _state and _record values are defined implicitly and maintained automatically by the Forms Runtime System (FRS). You can override the default value of Unchanged by assigning a value of Undefined, New, or Changed to _state when using insertrow to insert a row into a table field or a record into an array.
In an array, _state is primarily under programmer control. By default, _state is set to Unchanged when an array record is created and to Deleted when it is deleted. However, if a record is created through insertrow, you can specify a state of New or Changed, or Unchanged. This is useful primarily for applications in which you want to use an array that is based on a table field. You cannot set _state through an assignment statement.
In an array, _record is always set to the 1-relative position of the record in the array, and cannot be explicitly set. For deleted records, _record is negative or zero. Note that arrays do not have undefined rows.
You can set the _state of table fields and arrays using the insertrow and deleterow statements. These statements are discussed in
Manipulating Table Fields and Arrays.
The following table provides default values of _state for a table field row and an array record.