A literal is a value entered directly into your macro, as either a variable assignment or command argument. The following literals are recognized:
1. An integer value, eg: 317. You may also use hexadecimal notation, eg: 0x1AB3F.
2. A decimal (fractional) value, eg: 1.75.
Note: internally Nisus Writer stores these values as type “double” using 64-bit IEEE floating point. This may lead to small rounding errors as calculations are combined. The error amount is likely to be insignificant, but should be considered if exact values are important. See the command EqualFloats if you need to test floats for equality.
3. The constant @undefined. Some commands also return this value under special circumstances. Generally you don’t want to use an undefined value directly, but instead detect it using an If statement or the Defined command and take special action.
4. Either constant @true or @false. Commands may often refer to taking one action or another based on whether a value is true or false. In addition to these constants the following rules apply when considering whether a value is “true” or not:
a. The @undefined value is always false.
b. If a value is numeric, it is considered to be true if it is non-zero.
c. If a value is a string, it is considered true if it is non-zero in length and not equal to "0".
d. Any object, regardless of value, is considered to be true. This excludes strings (Text objects), which are instead considered under rule c above.
5. The constants @undefined, @true, and @false can also be written without the @ prefix as undefined, true, and false respectively. As of Pro v2.1 the use of bare keywords (without @) is deprecated.
6. Any of numerous text literals, as described in the following section.
Previous Chapter Variables |
<< index >> |
Next Chapter Text Literals |