GoTo Case Statement

Causes a statement of the type Select…Case to calculate again with a different expression.


GoTo Case expression [ Tol tolerance ]
GoTo Case Else


An expression with a data type compatible with the test expression in the line Select.
Optional floating-point expression. See Tol Clause for more information.
Causes execution to move to Case Else.


GoTo Case typically causes the construct Select to execute again with a different test expression. Each Case calculates again, until a test is true. Then its related block executes.

If no expressions of Case are true, or you use GoTo Case Else, execution moves to the block after Case Else, if there is one. But if there is no Case Else, execution moves to the statement after End Select.

You can put GoTo Case only in a block made with Case. And GoTo Case can move to a block only at the same level.

GoTo Case used with nested constructs can cause logic errors. You cannot be sure which block it can move to. Thus, we recommend that you keep nested constructs to a minimum.



See also