Previous Topic: Substring ValuesNext Topic: Predefined Variables


Example

Assume that the following variables have these values:

&A—TOUCH
&B—DOWN
&C—B
&AB—FIELDGOAL
&D(1)—EXTRA
&D(2)—POINT

The following table shows you how ACL/E will determine the value of the variables specified with substring notation:

Variable

What ACL/E does

Resulting Value

&A(1,2)

Returns the value of the two characters in &A starting with the position 1

TO

&A(2,8)

Returns the value of the eight characters in &A starting with position 2, but only returns four characters since there are only four characters to the right of position 2

OUCH

&C&B(2,2)

Returns the value of &C (which is the letter "B") followed by the value of the two characters in &B starting with position 2

BOW

&C(2,3)

Since the value of &C is only one character long, this statement returns no value

null substitution

&D(1)(3,2)

Returns the value of the two characters in the third and fourth positions of the first element of &D

TR

&D(1)(2,1)&D(2)

Returns the second character in the first element of &D and the contents of &D(2)

XPOINT