"Variant" - Data Type and Subtypes

This section provides a quick introduction of VBScript data type, Variant, a list of subtypes: byte, integer, long, single, double, currency, string, Boolean, date, object, error, empty, and null.

Interestingly, VBScript has only one data type called "Variant", which can be used store different kinds of data depending on how it is used. This tells us that VBScript is a loosely typed, or dynamically typed, language.

Even every piece of data in VBScript is considered as the same data type, "Variant", it can be grouped into a specific category of data based on its value. These categories of data are called subtypes.

VBScript supports the following 13 data subtypes:

See next sections to learn how to use Variant and subtypes.

Table of Contents

 About This Book

 Introduction of VBScript - Visual Basic Scripting Edition

Variant Data Type, Subtypes, and Literals

"Variant" - Data Type and Subtypes

 Data Literals

 Data Literal Examples

 String Data Literals

 Date and Time Data 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"

 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)


 Full Version in PDF/EPUB