The uselogic attribute
The uselogic attribute of the <description> element allows you to define more complex logical relations among multiple descriptors than are available with the default combining method described in the previous section.
HCL ZIETrans adds a default uselogic attribute to the <description> tag when you record the macro. It will be regenerated if you edit the macro in the host terminal or in the macro editors. It will not be regenerated if you edit the macro in the source view.
(1 and 2) or (!1 and 3)
This logical expression
is not a regular logical expression (as described in Conditional and logical operators and expressions) but rather a simplified style
of logical expression used only in the uselogic attribute. The rules
for this style of logical expression are:
- The numerals 1, 2, 3, and so on stand for the boolean results of, respectively, the first, second, and third descriptors in the <description> element (<oia>, <string>, and <cursor> in the figure above). You can use any numeral for which a corresponding descriptor exists. For example, if a <description> element has seven descriptors, then you can use 7 to refer to the boolean result of the seventh descriptor, 6 to refer to the boolean result of the sixth descriptor, and so on.
- Only the following logical operators are allowed:
Table 1. Logical operators for the uselogic attribute Operator: Meaning: and Logical AND or Logical OR (inclusive) ! Logical NOT (inversion) - You can use parentheses () to group terms.
- The following entities are not allowed:
- Arithmetic operators and expressions
- Conditional operators and expressions
- Variables
- Calls to Java™ methods
- The result of the first descriptor is true and the result of the second descriptor is true (1 and 2)
- The result of the first descriptor is false and the result of the third descriptor is true (!1 and 3)
Remember that if you use the uselogic attribute, then the macro runtime ignores the invertmatch and the Optional attribute settings in the individual descriptors.