"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
      Case expected_value_list_1
         statement_block_1
      Case expected_value_list_2
         statement_block_2
      ...
         ...
      Case Else
         statement_block_n
   End Select

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:

Table of Contents

 About This Book

 Introduction of VBScript - Visual Basic Scripting Edition

 Variant Data Type, Subtypes, and Literals

 Arithmetic Operations

 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" Statements

 "If" Statement Examples

"Select Case" Statements

 "Select Case" Statement Examples

 Loop Statements - "For", "While", and "Do"

 "Function" and "Sub" Procedures

 Built-in Functions

 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)

 References

 Full Version in PDF/EPUB