Flow control

Navigation:  Client commands > Tools > Client command editor > Command list >

Flow control

Version 1.0.1

Show hidden text

The operation of a Client Command can be controlled with the help of flow control elements. Branches as well as loops are used to this end. In the event of a branch, the Client Command executes only a a part, and ignores other parts, while in a loop one part is executed repeatedly.

 

hmtoggle_arrow1If ... Then

With this command it is possible to initiate a program branch on the basis of a comparative expression. If the relational expression is true ("true"), then the commands subordinated to this command are executed.

 

5.8.3.2.10 - IfThen

 

In order to create a relational expression, enter a first value (by hand or as a variable) in the Details tab. Enter another value (Value2) and select a matching mathematical relational operator from the drop-down menu (<> is not equal). As an option you can define if the comparison should be case-sensitive or not.

 

Hinweis

Note:

If you compare a date or a point of time with the content of a variable, remember to save the dates and points of time in the format that is set in Windows (Control panel => Regional and language options).

 

hmtoggle_arrow1Else

With this command you can supplement the If ... Then command. It represents an Else condition. In this way you can compile commands that will be executed if the If ... Then condition is not true.

 

Make sure that the indentation of this command is the same as a preceding If...Then condition and that no command with the same indentation is between these two commands, as this would otherwise render this command ineffective.

 

hmtoggle_arrow1While … Do

The While ... Do command constitutes a loop. The subordinate commands will be executed in sequence as long as a given relational expression is true ("true"). In this way, for example, a variable with multiple values can be processed.

 

Enter a relational expression in the same way as for an If...Then statement: Enter two values, select a mathematical relational operator (<> is not equal to), and verify if the command should be case-sensitive.

 

hmtoggle_arrow1Switch

With this command you can create a program branch similar to an If...Then statement. However, in this case, the branching takes place according to the value of the a variable without prior testing. Therefore one or multiple case instructions must be subordinated to the switch. It is also advisable to enter an Else statement at the end, if none of the case statements is true.

 

5.8.3.2.10 - Switch

 

Enter the variable for this command under the Details tab, according to which the value is to be branched and if the variable should be case-sensitive.

 

hmtoggle_arrow1Case

The Case statement is part of a switch statement and reflects an individual case. The content of the variable, which is specified in the Switch statement is placed in a context by the Case statement. If the variable content is equal to the requirement of the case, the subordinate commands are executed. This is achieved by entering a possible variable value in the input field in the Details tab.

 

hmtoggle_arrow1Exit script

This command terminates the part of the Client Command that is currently running. If the Exit script is called in a console script, the client script is executed nevertheless. To finish, you can set a return value and state a reason. This can be useful if the Client Command is called by other Client Commands which expect an appropriate return value.

Last change on 10.03.2014