Statements
Statements control how, or in what order, objects are manipulated.
Assignment statements
Evaluate an expression and assign the result of the expression to an object. See
Assignment statements.
Call statements
Used to call an object's methods. These methods typically modify the object they are called from, or perform a unit of work. See
Call statements.
Conditional statements
Conditional statements control the flow of execution in a script. They perform a test and then execute one section of code if the test evaluates to True (nonzero). They might execute another section of code if the test evaluates to False.
Iteration statements
Provide for repeated execution of a block of code until a specified termination criterion is met. Looping allows you to run a group of statements repeatedly.
Do...Loop: Loops while or until a condition is True.
While...End While: Loops while a condition is True.
For...Next: Uses a counter to run the statements a specified number of times.
For Each...Next: Repeats a group of statements for each item in a collection or each element of an array.
Object collection iteration: Repeats the same statement for each object in a collection.
Jump statements
Jump statements either transfer execution to a different script location or return control from the script.
GoTo: Transfers control unconditionally to a specified line in the script.
On Error: Enables or disables an error handling routine and specifies the location of the routine.
Exit: Exits a script block, returning control to the application or object calling the script.
Script block statements
Script block statements group a block of statements into a logical unit of work. Block statements do not add to the script logic, they just make the script more readable.
With: Groups a series of statements that executes on a single object.
Section: Groups a series of statements together into a script section.
See also