"Select Case" Statements
This section describes how 'Select Case' statements work. If one of the expected value in a case clause equals to the test value, the statement block in that case clause will be executed.
"Select Case" statement is an alternative way of executing statements selectively based on certain conditions.
Here is the syntax of "Select Case" statements:
Select Case test_value
where "test_value" is a value used to test against with expected values specified in the "Case" clauses,
and "expected_value_list_*" are lists of expected values.
The execution of "Select Case" statement goes like this:
- Each "Case" clause will be visited sequentially from top to bottom.
- If one of the values in the expected value list equals to the test value in a "Case" clause,
the statement block in that clause will be executed.
- If the statement block of any "Case" clause gets executed, the entire statement ends.
- The "Case Else" clause is a special clause. Its statement block will be executed if and only if
no statement block of any other "Case" clauses gets executed.
Table of Contents
About This Book
Introduction of VBScript - Visual Basic Scripting Edition
Variant Data Type, Subtypes, and Literals
Numeric Comparison Operations and Logical Operations
String Operations - Concatenation and Comparison
Variable Declaration and Assignment Statement
Expression and Order of Operation Precedence
Statement Syntax and Statement Types
Array Data Type and Related Statements
Array References and Array Assignment Statements
►Conditional Statements - "If ... Then" and "Select Case"
"If" Statement Examples
►"Select Case" Statements
"Select Case" Statement Examples
Loop Statements - "For", "While", and "Do"
"Function" and "Sub" Procedures
Inspecting Variables Received in Procedures
Error Handling Flag and the "Err" Object
Regular Expression Pattern Match and Replacement
scrrun.dll - Scripting Runtime DLL Library
Creating Your Own Classes
IE Web Browser Supporting VBScript
IIS ASP Server Supporting VBScript
WSH (Windows Script Host)
Full Version in PDF/EPUB