Was this helpful?
Referencing Arrays
The syntax for referencing the values in arrays of records is similar to that for table field columns. Unlike with table fields, there is never a current record in an array, except in an unloadtable loop (discussed in Unloadtable).
You can reference the values in arrays by placing the index number inside square brackets [ ] . Use this syntax:
array_identifier [integer_ref].attribute_identifier
When referring to array records by index position, remember that if you insert or delete a record in the middle of an array, the index numbers of the subsequent records are changed.
The following example sets the Name attribute of the second record of the employee array:
employees[2].name = 'Jones'
In the following example, an array is declared to be of type of form "empform." The form contains the table field "dependents." The example sets the Dependent Name attribute for the third record of the array (which contains the second row from an array based on the table field):
a_empform[3].dependents[2].dep_name= 'ralph';
Last modified date: 04/03/2024