Conditional
Purpose: |
Change the flow of script execution, based on the results of a simple comparison of two items. When the statement is True, execution continues until an “EndIf” or “Else” Action is encountered. Otherwise, execution begins with the first line following the next “Else” (optional) or “EndIf” command. |
||||||||||||||||
Category: |
Conditional |
||||||||||||||||
Syntax: |
If "first item" operator "second item" first item The first item to compare. Can contain text, numbers, math expression, variables, etc. operator One of the following:
second item The second item to compare. Can contain text, numbers, math expression, variables, etc. |
||||||||||||||||
Example: |
The following example examines the contents of the variable [Name]. If [Name] is empty an error message appears, otherwise, the next page is displayed: If [Name] == "" You can also use If to detect the correct entry of a password: If [Password] == "Bravo172" |
Purpose: |
Change the flow of script execution based on the result of a complex expression. This is an advanced version of the standard If Action. When the statement is True, execution continues until an “EndIf” or “Else” Action is encountered. Otherwise, execution begins with the first line following the next “Else” (optional) or “EndIf” command. |
||||||||||||||||
Category: |
Conditional |
||||||||||||||||
Syntax: |
IfEx "expression" expression A basic expression consists of three elements - two items to be compared separated by a special operator. For example: "item operator item" The two items can be text, numbers, math expressions, variables, etc. The operator must be one of the following:
For example, the following expression compares the variable [City] to “Madrid” or to "Chicago": IfEx [city] == "Madrid" or [city]=="Chicago" To find out if [city] equals “Madrid” and another variable [name] also equals “John”: IfEx [City] == "Madrid" and [Name] == "John" For extremely complex statements you may want to use “(“ and “)” to make sure expressions are evaluated in the correct order. |
||||||||||||||||
Example: |
IfEx [account] == "Guest" or ([account] == "Admin" and [name] == "John") |
Purpose: |
Repeat a series of Actions until a specified condition is no longer valid. Any Actions between the While and its matching EndWhile statement will continue to execute until the specified condition is no longer true. |
||||||||||||||||
Category: |
Conditional |
||||||||||||||||
Syntax: |
While "first item" "operator" "second item" first item The first item to compare. Can contain text, numbers, math expression, variables, etc. operator One of the following:
second item The second item to compare. Can contain text, numbers, math expression, variables, etc. |
||||||||||||||||
Example: |
In the following example, the variable [count] is increased from its iniatial value of 0 to 100, one by one. SetVar [count] 0 |
Purpose: |
Repeat a series of Actions until a specified condition is met. This is an advanced version of the standard While Action. |
Category: |
Conditional |
Syntax: |
WhileEx "expression" expression The expression to be evaluated. See IfEx for information about constructing expressions. |
Example: |
WhileEx [x] > 0 and [y] > 0 SetVar [x] [x]-1 SetVar [y] [y]-1 EndWhile |
Purpose: |
Exit the current While/WhileEx/EndWhile block. Execution continues with the Action following the next EndWhile statement. |
Category: |
Conditional |
Syntax: |
ExitWhile |
Example: |
SetVar "[name]" "" |
Purpose: |
Jumps over the itaration in the loop. |
Category: |
Conditional |
Syntax: |
Continue |
Example: |
The following example will show an AlertBox for each number from 1 to 5 except for number 3: Loop 1 5 [counter] If [counter] "==" 3 Continue EndIf |
Purpose: |
Repeat a group of Actions a specified number of times. |
Category: |
Conditional |
Syntax: |
Loop "start value" "stop value" "variable counter" start value The starting value for the loop. stop value The ending value for the loop. variable counter The name of the variable to use as a counter. (Required) Actions between the Loop and EndLoop statements will execute the number of times it takes to increment the counter variable from start to stop. |
Example: |
The following example show 5 alert messages from 1 to 5 Loop 1 5 [counter] |
Purpose: |
Repeat a group of Actions a specified number of times. |
Category: |
Conditional |
Syntax: |
Loop "start value" "stop value" "variable counter" start value The starting value for the loop. stop value The ending value for the loop. variable counter The name of the variable to use as a counter. (Required) Actions between the Loop and EndLoop statements will execute the number of times it takes to decrement the counter variable from start to stop. |
Example: |
The following example show 5 alert messages from 5 to 1: LoopDown 5 1 [counter] |
Purpose: |
Loop through all properties in a JSON object. |
Category: |
Conditional |
Syntax: |
LoopObject [variable name] [json object] variable name Variable to store properties. json object The JSON object. |
Example: |
The following example reads and displays in a Container Object all the properties in a JSON object: CreateEmptyObject [myobject] SetVar [myobject.name] "Peter" SetVar [myobject.age] 34 SetVar [myobject.country] "Germany" LoopObject [property] [myobject] GetObjectHTML "Container1" [content] SetObjectHTML "Container1" "[content][property]<br>" EndLoop |
ExitLoop
Purpose: |
Exit the current Loop/EndLoop block. Execution continues with the Action following the next EndLoop statement. |
Category: |
Conditional |
Syntax: |
ExitLoop |
Example: |
Loop 1 100 [Count] |
Wait
Purpose: |
Postpone the execution of a group of actions for a specified number of milliseconds. |
Category: |
Conditional |
Syntax: |
Wait |
Example: |
Wait 1000 |
Purpose: |
Exit the current script or subroutine. |
Category: |
Conditional |
Syntax: |
Return |
Example: |
Return |
Refresh
Purpose: |
Force the screen to redraw itself. Used to provide visual feedback during loops or when you need instant variable value representation on screen. |
Category: |
Conditional |
Syntax: |
Refresh |
Example: |
Refresh |