STATEMENT: Select Case
conditional statement selectively executes different groups of code by comparing a variable to a
(a series of conditions). If one of the cases (conditions) is satisfied, then the code associated with that case is executed.
You may specify multiple, comma-delimited conditions for each
as in the first example below. If there not is a match, then the
is skipped over and the next
is considered, and so on for each
Note that it is quite possible that none of the cases will be satisfied. Therefore, you may wish to use the optional
statement. It will only execute if none of the other conditions match.
You must end the
or you will get an error message.
Select Case finalnumber
Case 1, 5
result = "The result is 1 or 5"
result = "The result is 2"
result = "The result is 3"
Select Case firstname
Welcome = "Hello Brenn"
Welcome = "Hello Fred"
Welcome = "Hello Susan"
Welcome = "Hello world"
Copyright 1999-2004 by Infinite Software Solutions, Inc. All rights reserved.