End Select
Parameters
| None. |
Description
|
Closes a Select block. Every Select finishes with End Select. It closes the whole block, including all of its Case branches and any Default. It is also the jump target for a finished branch. Because Select has no fall-through, running off the end of a Case sends control straight here, skipping every remaining branch. Anything between the Select line and the first Case is unreachable, so keep the block tidy - open the Select and start the first Case immediately. Nested Selects each need their own End Select, matched innermost first. See also: Select, Case, Default, EndIf. |
Example
; End Select Example ; ------------------ ; Inspect each weapon slot and see which branch Select picks For slot=1 To 4 Print "Weapon slot "+slot+":" Select slot Case 1 Print " Laser - rapid fire, low damage" Case 2 Print " Missile - slow but devastating" Case 3 Print " Flamethrower - short range, big burn" Default Print " Empty - nothing equipped" ; End Select closes the whole Select structure End Select Next Print "" Print "Press any key to close the example" WaitKey End
Index