Otherwise,-If-the-Condition-Is-Satisfied-,-Perform-the-Following-Operations
Command Description
Otherwise, if the Conditional Expression (Expression) is true, the execution sentence block (block), otherwise the included statement block does not perform the elseif statement multiple times, corresponding to more Conditional Branching, but only within the IF / END block
Command Prototype
ElseIf expression
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
expression | True | expression | 1 > 0 | The expression used for judgment |
Demo
TracePrint("--------------------------------------Conditional branch--------- ----------------------------------")
//-------------------------------------------------------------------------------
//[Remarks] If the expression expression is true, execute the Yes Block statement block, otherwise execute the No Block statement block. The ElseIf statement can appear multiple times, corresponding to more conditional branches. If the ElseIf and Else statements are not required, they can be omitted, and the corresponding statement block does not need to be written.
TracePrint("Let the variable a be UiBot, the conditional branch judge whether a is equal to 1, and then judge whether a is equal to UiBot and execute the corresponding statement block")
a = "1"
If a = 1
TracePrint "yes"
ElseIf a = "UiBot"
TracePrint "no"
End If