Array Subscripting [ HP Transact Reference Manual ] MPE/iX 5.0 Documentation
HP Transact Reference Manual
Array Subscripting
Occurrences of compound items and child items of compound items can be
manipulated using subscripting. Array subscripting is allowed within the
context of most verbs except when the Transact registers are being
manipulated or updated. The only other case where subscripting is not
allowed is with data items included in the LIST= option for any of the
input/output verbs (such as DELETE, FILE, FIND, GET, PUT, REPLACE, and
UPDATE). The error message, "Subscript not permitted in this context," is
displayed when such an attempt is made. The discussions of verbs in
Chapter 8 specify exactly when array subscripting is allowed.
In contexts where subscripting is allowed, the following format is used:
__________________________________________________________________
| |
| |
| (array-item[(subscript1[,subscript2 ...[,subscriptn]])])...|
| |
__________________________________________________________________
Parameters
array-item The array item must be either a compound item or a
child item of a compound item. This parameter is
required.
(subscript) A subscript can consist of a data item, constant,
or an arithmetic expression. Subscripting is most
efficient if the subscript is either a constant, a
16-bit integer item, or a simple expression (less
than three operands) consisting of 16-bit integers,
constants, or both. When a data item is used as a
subscript, it must be enclosed in parentheses
within the subscript parentheses. This parameter
is optional. If no subscript is specified, the
array item is treated as a single or compound data
item.
The first subscript applies to the highest level of
the compound item of which the array item is the
child. Each succeeding subscript refers to the
next level in the array. Once the first subscript
value is specified, any omitted values will default
automatically to 1. Since each level adds to the
complexity of the program, we recommend that the
number of subscripts be kept at a manageable level.
The maximum number of allowable subscripts is 16.
The subscript value is evaluated at run time to
determine which occurrence of the array item is to
be referenced. A subscript value of 1 references
the first occurrence of the array; subscript values
less than 1 or greater than 32,767 are invalid.
MPE/iX 5.0 Documentation