Skip to main content
Version: v6.7.0

SelectCase

Command Description​

Calculate the decision value and compare it with the candidate value of each branch. If it is equal to a candidate value, execute the statement block of that branch. If it is not equal to any candidate value, execute the statement block of the "other branch" (if any).

Command Prototype​

Select Case expression 

Case 1

End Select

Parameter Description​

ParameterRequiredTypeDefaultDescription
expressionTrueexpressiona + bThe expression used for judgment

Demo​

TracePrint("------------------------------------Conditional branch statement block------- ------------------------------------") 
//-------------------------------------------------------------------------------
TracePrint("Let a be 1, select according to a+1, if a+1 is 2, execute the flow block under Case 2")
a = 1
Select Case a+1
Case 2
TracePrint(2)
Case 3
TracePrint(3)
End Select