## ALP Programming Guide and Reference

[prev][next][parent][TOC]

### Text Expansion Operator (%)

Description

Constraints

Examples

The % Text-Expansion-Operator has different effects depending upon the context in which it is used. Its primary purpose is convert various sources of information into text literals that may in turn be passed to macros as arguments.

The % Text-Expansion-Operator causes the following types of conversions:

Line Expansion

When used as the first token on the line, the % operator forces expansion of Text-EquateName s in contexts where they would otherwise be left unexpanded. Text-EquateName s passed as arguments to macros are not automatically expanded; this is one context where the % operator is useful.

Expansion of a Text Equate Operand

As with Line Expansion, the % operator may be used within the body of a line to expand individual Text-EquateName s. This can be useful when expansion of all Text-EquateName s on the line is not desired.

Conversion of Numeric Expression to Text

If the Text-Expansion-Operator is not the first token on the line or immediately followed by a Text-EquateName, then the argument of the % operator is assumed to be an Expression, which is evaluated and converted to the text representation of its value. This is useful when the need arises to pass the text representation of a number to a macro.

Text-Expansion-Operator:
% 2nd through Nth token on line
% Text-EquateName
% Expression