6. Working with Arrays, Table Fields, and Collections : Arrays : How You Can Manipulate Arrays : How You Can Change Values in an Array
 
Share this page                  
How You Can Change Values in an Array
If an array is not displayed in a table field, the only way to change one of its values is by assignment. For example, the following statement updates the account balance of the customer in the fifth row:
custtable[5].acctbalance = custtable[5].acctbalance
    + credit - debit;
If your array's data type is a dynamically created user class, you must use a DynExpr to change values programmatically. For more information about changing values in dynamically created arrays, see Creating Dynamic Frames (see Creating Dynamic Frames).
If an array is displayed in a table field whose bias allows data modification, the user can edit and change the displayed data. For a description of the biases for table fields, see Creating Dynamic Frames (see Creating Dynamic Frames).
If two or more array variables point to the same data set and you change a value in the data set, the change is reflected in all the array variables that point to that data set. If any of the array variables is displayed in a table field, refresh the display to make the change visible if you want it to appear prior to the end of the event block. To refresh the display, use the UpdField method defined for the ActiveField system class.
The following statement updates display of the custtable table field:
field(custtable).UpdField();