CONST, GLOBAL, LOCAL |
Top Previous Next |
Syntax
const|global|local ID=value
Description
The const keyword provides the capability to use a named value as a parameter to other keywords. If, for example, you want to place a series of text values at a certain column position, but may need to adjust the position in the future, and then set a constant ID to the column position value, then use the ID in the column position of all the text values.
const COLPOS=22.25 text COLPOS,30,"Text line 1" text COLPOS,31,"Text line 2" text COLPOS,32,"Text line 3"
A given constant ID can be reused, and references to it in subsequent rule set lines will reflect the new value. Also, a constant defined before the first rule set in the rule file will apply to any rule sets in the file, unless the same ID is reused in any particular rule set. The global command may be used in place of const for one of these pre-rule set constants. Likewise, the local command can be used in place of const inside a rule set.
Note that case does make a difference. "COLPOS" and "colpos" are different constants. Take care not to use constant names that may inadvertently cause unintended replacements. For example, it may be tempting to use a constant named "font", but this would conflict with any font command. There would be no conflict, however, between a constant named FONT and a lower-case font command.
Constant names are limited to 255 characters, and constant values are limited to 65,536 characters. If you use a quoted value, the outer quotes are removed before the value is substituted into the rule file commands. You can therefore include quotes inside a quoted constant. Unquoted values are trimmed of leading and trailing spaces.
Long constant values can be built by including the constant name in multiple const commands, like this:
Const VAL="Initial Value" Const VAL="VAL plus this appended data" Const VAL="VAL and still more appended data"
Drivers: all
|