Replaces a symbol with a value at compile time.
EQUATE symbol TO expression [, ...]
EQU symbol TO expression [, ...]
EQUATE symbol LITERALLY str [, ...]
EQU symbol LIT str [, ...]
||The placeholder symbol to be replaced, specified as one or more characters. The first character must be a letter or percent sign (%). Subsequent characters may be letters, numbers, percent sign (%), underscore (_), or dollar sign ($). The final character may not be an underscore.
||The value used to replace all instances of symbol at compile time. Any valid Caché MVBasic expression.
||The string used to replace all instances of symbol at compile time. Specified as a quoted string.
replaces every instance of symbol
in the program with the specified expression or variable. EQUATE
performs this substitution at compile time. Therefore, the value replaced is not affected by program execution. EQUATE
can be used to replace executable statements in the program. Variables perform substitutions during program execution and cannot be used to modify the program's executable code.
treats a sequence of words separated by >
as a single entity. For example:
EQUATE vin TO car(7)
AutoCheck->vin = vin
The following example replaces at compile time every instance of the symbol addlength
with the expression BYTELEN(x)+20 or LEN(x)+10, depending on the setting of the Unicode variable:
THEN EQUATE addlength TO BYTELEN(x)+20
ELSE EQUATE addlength TO LEN(x)+10
The following example replaces at compile time every instance of the symbol letters
with the contents of the variable alpha
EQUATE letters LITERALLY "alpha"
© 1997-2019 InterSystems Corporation, Cambridge, MA