Section A.14. Program Structure and Flow

A 14 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, and 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

Declares a procedure

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

Defines a prototype for a property procedure that sets a reference to an object

Public Statement

Declares a global or public variable or function. In a class, marks the member as part of the class' public interface

Select Case...

End Select Statement

A series of code blocks of which only one will execute based on a given value

Sub Statement

Declares a procedure that does not return a value

While...Wend Statement

Repeats a section of code while or until a condition is met

With...End With Statement

Allows the implicit use of an object reference

Категории