Skip to main content

If-the-Branch-Meets-the-Condition,-Then-Execute-the-Branch-Block

Command Description

Independent Case conditional branching can only be used together with Select Case statements, and multiple conditional branchings can be added

Command Prototype

Case expression 


Parameter Description

ParameterRequiredTypeDefaultDescription
expressionTrueexpression1The expression used for judgment

Demo

TracePrint("--------------------------------------Conditional branch--------- ----------------------------------") 
//--------------------------------------------------------------------------------------------
//[Remarks] It can only be used in combination with the Select Case statement. The expression of Select Case satisfies all the conditions of the subsequent Case and will execute the logic of the case branch
a = 1
Select Case a + 1
Case 1
TracePrint("This is Case 1")
Case 2
TracePrint("This is Case 2")
Case 3
TracePrint("This is Case 3")
End Select