Testing Variable Values with the [ ] Operators

You can use square brackets [ ] to test for the existence or value of a variable.

You can use square brackets to
  • Include optional strings and variables, or lists of strings and variables in the syntax of SQL statements: [%variable%]

  • Test the value of a variable and insert or reconsider a value depending of the result of the test: [%variable%? true : false]

  • Test the content of a variable [%variable%=constant? true : false]

Variable

Generation

[%variable%]

Tests for the existence of the variable.

Generation: Generated only if variable exists and is not assigned NO or FALSE.

Reverse: Evaluated if the parser detects a SQL statement corresponding to the variable and it is not assigned NO or FALSE.

[%variable%? true : false]

Tests for the existence of the variable and allows conditional output.

Generation: true is generated if variable exists and is not assigned NO or FALSE. Otherwise, false is generated.

Reverse: If the parser detects variable and it is not assigned NO or FALSE, true is reversed. Otherwise, false is reversed. variable is set to True or False as appropriate.

[%variable%=constant? true : false]

Tests the value of the variable and allows conditional output.

Generation: If variable equals constant, true is generated. Otherwise, false is generated.

Reverse: If the parser detects thatvariable equals constant, true is reversed. Otherwise, false is reversed.

[.Z: [item1][item2]...]

Specifies that the items do not have a significant order.

Generation: .Z is ignored

Reverse: The items can be reversed in any order they are encountered.

[.O: [item1][item2]...]

Specifies that the items are synonyms, only one of which should be output.

Generation: Only the first item listed is generated.

Reverse: The reverse parser must find one of the items to validate the full statement.

Examples