This function is used to compare numeric values. An integer or decimal comparison can be performed. Integer comparisons are performed unless the Compare decimal setting is enabled. The source may be a field value, a property value, a named variable's value, a track variable's value or a text string. The compare against field can be a text string, the contents of a named variable or the contents of a track variable.
When any Yate function requires an integer value, any leading integer value is accepted. If there is no leading integer, zero is assumed. For example an empty string is interpreted as 0 and -123Test is interpreted as -123. The same holds when a decimal value is required. 23.45-abc is treated as 23.45.
This statement has five special compare tests which can be used to validate that a string contains a non empty pure value. Note that leading and trailing spaces are valid. The setting of Decimal compare is irrelevant for these modes. The special tests are:
The statement can also test for true or false. The numeric value which is potentially tested is an integer or decimal value depending on the Compare decimal setting.
When specifying named variables or text you may use any of the escape sequences described in Escape Sequences.
If you specify a result of Set, the action's test state will be set to True or False depending on the result of the test. If you specify a result of And, the action's test state will be set to false if the result of the test is false. If you specify result of Or, the action's test state will be set to true is the result of the test is true.
In stepwise execution mode the following holds:
You can choose to save the per file results of the test to a track variable. This is not supported when comparing against a named variable. When setting a track variable, the Set, And, Or semantics are applied, therefore cumulative tests will be saved as expected. The result variable will always be a 0 or 1. The Run statement can selectively choose which files are to be executed based on the True or False value of a track variable.
This statement is also capable of setting the action debug state as opposed to the action test state. This is enabled by the Debug control. More information can be found in Debugging Actions.