Program Structure and Flow

Call Statement

Passes execution to a subroutine or event handler

Do... Loop Statement

Repeats a section of code while or until a condition is met; can take the form of Do Until...Loop (loops until an expression is True), Do...Loop Until (loops at least once until an expression is True), Do While...Loop (loops while an expression is True), and Do...Loop While (loops at least once while the expression is True)

Exit Statement

Branches to the next line of code outside of the currently executing structure; can take the form of Exit Do, Exit For, Exit Function, Exit Property, and Exit Sub

End Statement

Marks the end of a program control structure; can take the form of End Class, End Function, End If, End Property, End Select, End Sub, End With

For Each...Next Statement

Iterates through a collection or array of objects or values, returning a reference to each of the members

For...Next Statement

Iterates through a section of code a given number of times

Function Statement

Defines a prototype for a procedure that returns a value

If..Then..ElseIf...Else Statement

Defines a conditional block or blocks of code

Private Statement

Declares the procedure or variable to have scope only within the module in which it is defined

Property Get Statement

Defines a prototype for a property procedure that returns a value

Property Let Statement

Defines a prototype for a property procedure that accepts a value

Property Set Statement ...

Get VBScript in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.