The text read off it
[02.04.07]
2. Comparisons of fields of unequal length
a) Numeric fields are compared arithmetically without regard to length.
b) Alphameric fields of unequal length are treated on the basis of the operator used in the comparison.
i. In tests for an = or NOT = condition the fields will always be found to be unequal. In the following example where fields A and B are of alphameric type with unequal length the only code generated will be a transfer to D.
IF A = B THEN GO TO C OTHERWISE GO TO D.
IF A NOT = B THEN GO TO D OTHERWISE GO TO C.
ii. In tests for NOT greater or less conditions the lengths are made equal by right truncation of the longer field.
-
For purposes of comparison edited fields (see 02.05 for definition) are converted to pure numeric fields. They may not be compared to alphameric fields.
-
All non-format fields (see 02.05 for definition) are compared alphamerically, subject to rules stated in 2b above.
-
Variable length fields may not be compared. (A variable length field is a field which uses the QUANTITY IN option).
-
For comparison purposes zero is considered an unsigned number, even though computational sequences generated by the compiler may produce negative or positive zeros.
D. Subscripting and Indexing
A source program may refer to array elements through use of subscripted names such as A(J, K). Each unique subscripted name appearing in one or more Procedure statements causes the Compiler to generate a positional indicator which will serve to locate the array element when the program is executed. For example, each of the following subscripted names would cause the Compiler to generate a positional indicator although they refer to elements in the same array: A(J, K), A(J, K+1), A(2,3), A(2,1). Only one positional indicator will be generated for each, regardless of the number of times each is referenced.
A positional indicator contains the location (word and byte) of the particular element being referred to by the present values of the subscripts. The value of the positional indicator is a function of the location of the array, the dimensions of the array, and the values of the subscripts. A positional indicator with constant subscripts such as A(2,3) may be a load-time constant or may change in value if the dimensions or base location of the array vary during the execution of the object program.
