What Is a Statement?

This section provides an introduction of what is an expression. A data literal or a variable is a simple expression. A single operation or a group of multiple operations is a complex express.

A Statement is a basic execution unit of VBScript source code. A statement tells the computer to perform a piece of work. For example, a declaration statement declares a variable. An assignment statement assigns a value to a variable.

Here are some general rules about VBScript statements:

1. Each statement must have a statement keyword to identify the type of the statement. But there is one exception, the "Call" keyword of the function call statement is optional. For example, "Dim" is the keyword to identify a variable declaration statement. "document.writeln(...)" is call statement.

2. One line can not have more than one statement. For example, "Dim price=9.99" is not a valid statement. "x=1, y=2" is not a valid statement.

3. One statement is usually written in one line. But if you want to continue a statement on the second line, you must put (_) at the end of the first line like this:

   statement_part_1 _

4. Comments can be entered at the end of a statement proceeded with (') like this:

   statement ' comment

5. Statement keywords are case insensitive. For example, "Dim" and "DIM" are the same keyword.

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

What Is a Statement?

 Commonly Used Types of Statements

 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)


 PDF Printing Version