SPNU118Y September 1995 – February 2020
In a macro, you can access the individual characters (substrings) of a substitution symbol with subscripted substitution symbols. You must use the forced substitution operator for clarity.
You can access substrings in two ways:
This method of subscripting evaluates to a character string with one character.
In this method, expression1 represents the substring's starting position, and expression2 represents the substring's length. You can specify exactly where to begin subscripting and the exact length of the resulting character string. The index of substring characters begins with 1, not 0.
Example 8 and Example 9 show built-in substitution symbol functions used with subscripted substitution symbols. In Example 8, subscripted substitution symbols redefine the ADD instruction so that it handles short immediate values. In Example 9, the subscripted substitution symbol is used to find a substring strg1 beginning at position start in the string strg2. The position of the substring strg1 is assigned to the substitution symbol pos.