Trigger variable operations
Trigger variable operations are operations that are performed on any trigger variable (predefined or user-defined). DPA performs operations on variables when a trigger is fired. When a trigger fires, all variables are supplied with values and all operations are performed immediately and any resulting new values are either saved or used immediately, both within the trigger command line and also for subsequent trigger criteria evaluations.
Mathematical operations with trigger variables
DPA can perform mathematical operations on variables which contain numerical values. The variable type that the resulting value is assigned to ( string, integer, double ) will dictate the precision of the operation.
For example, if a the variable containing "0123.456" is assigned to string, it will be evaluated as 0123.456, but will not be able to be used in a mathematical operation. The same variable assigned to integer is evaluated as 123 and the same variable assigned to double is evaluated to 123.456.
Make sure that the variable is created and is of the type you want to use or your results may not be what you expect. The following mathematical operations can be performed:
-
Addition
-
Subtraction
-
Multiplication
-
Division
-
Comparative (greater than, less than, equal to)
Trigger variable operations on text strings
Trigger variables which are of the string type or are treated as if they are of string type. The resulting variable from the operation must be stored as the appropriate type. You may use system variable in these operations, but you cannot use one of the system variables to store the resulting variable as system variables are read-only.
-
Concatenate two strings - DPA triggers can pass back the text of two trigger variables, and combine the text to create a third variable (A+B=AB). The third variable would contain the two strings together.
-
Parse strings - Text obtained from the window on screen can be parsed to create a substring of the original. This allows a trigger variable to store only specific portions of captured text.
-
Trim strings - this can be used to Capture a subset of characters or numbers in a variable. Trim strings are treated as text even if the string itself is numeric.
-
Using Regular Expressions - either on, before or after first or last match.