Skip to main content


Command Description

If the expression "expression" is true, the Yes Block is executed; otherwise, the "No Block" is executed. ElseIf statements may appear multiple times with more conditional branches. ElseIf, Else statements, and the corresponding statement Block are not necessary

Command Prototype

If expression 

End If

Parameter Description

expressionTrueexpression1 > 0The expression used for judgment


TracePrint("--------------------------------------Conditional branch--------- ----------------------------------") 
//[Remarks] If the expression expression is true, execute the Yes Block block, otherwise execute the No Block block. ElseIf statements can appear multiple times, corresponding to more conditional branches. ElseIf and Else statements can be omitted if they are not needed, and the corresponding statement blocks do not need to be written.
TracePrint("Let the variable a be UiBot, the conditional branch judges whether a is equal to 1, print yes, otherwise print no, the result is: ")
a = "UiBot"
If a = 1
TracePrint "yes"
TracePrint "no"
End If