Select-One-from-Multiple-Branches-According-to-Analysis-and-Conditions
Command Description
Select one of the branches based on certain conditions. Evaluate the expression following the Select Case and determine if there is a Case branch that matches the value of the expression. If yes, execute the corresponding Case branch block. Otherwise, execute the Case Else branch block
Command Prototype
Select Case expression
Case 1
End Select
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
expression | True | expression | a + b | The 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