34,333
edits
Changes
→Evaluating Multiple Possibilities using Select Case
== Evaluating Multiple Possibilities using Select Case ==
The Visual Basic ''Select Case'' construct is extremely useful if you need to evaluate a value or expression against multiple possible outcomes. For example you might want to compare a string against a variety of other strings in order to decide what action to take. The syntax for the ''Select Case'' construct is as follows:
'''Select Case''' ''expression''<br>
'''Case''' ''value1, value2, ...''<br>
...<br>
'''Case''' ''value3, value3, ...''<br>
...<br>
'''Case''' ''value1, value2, ...''<br>
...<br>
'''End Select'''