The explanation of arrays applies to tables except for the following
differences:
- Activity
- Differences
- Defining
- A table name must be a unique symbolic name that begins with
the letters TAB.
- Loading
- Tables can be loaded only at compilation time and prerun-time.
- Using and Modifying table elements
- Only one element of a table is active at one time. The table
name is used to refer to the active element. An index cannot be specified
for a table.
- Searching
- The LOOKUP operation is specified differently for tables. Different built-in functions are used for searching tables.
Note: You cannot define a table in a subprocedure.
The following can be used to search a table:
- The LOOKUP operation code
- The %TLOOKUP built-in function
- The %TLOOKUPLT built-in function
- The %TLOOKUPLE built-in function
- The %TLOOKUPGT built-in function
- The %TLOOKUPGE built-in function
For more information about the LOOKUP operation code,
see:
For more information about the %TLOOKUPxx built-in functions,
see %TLOOKUPxx (Look Up a Table Element).