VBScript Tutorials - Herong's Tutorial Examples - Version 5.23, by Dr. Herong Yang
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 _ statement_part_2
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