Arrays
An array is a collection of records. Like records, arrays allow you to group data logically and create consistency throughout your application. You can define arrays as global variables through ABF frames or as local variables through 4GL declarations.
Like the arrays defined in 3GL languages, 4GL arrays consist of records that are all of the same record type. By referencing the array itself, you can work with the entire set of included records as a unit.
Unlike 3GL arrays, 4GL arrays are dynamic, allowing you to assign any number of records. The array automatically adjusts as you insert and delete components at any index position.
The index is an integer tag that distinguishes the records in an array from each other. Any record in an array can be addressed by its index at any time.
4GL supports only arrays of records; it does not support arrays of simple data types, as the C programming language does. While you cannot have an array of integers or characters, you can create records from these data types and then make an array of those records. For example, an array can be of a record type Employee, which is made up of three simple fields: Name, Emp_No, and Social_Security_No.