Flow Control

The following functions can be used to manage program execution/flow:

%DEF

Determine if an equate has been previously defined

#IF

Define sections of source code to be compiled or ignored

#TOOLS

Enable/disable integrated development tools in compiled code

CALL

Invoke a procedure (Sub, Function, Method, or Property)

CALL DWORD

Invoke a procedure (Sub, Function, Method, or Property) indirectly

CALLSTK

Capture a representation of the stack frames in the call stack

CALLSTK$

Retrieve the details of a specific stack frame

CALLSTKCOUNT

Retrieve the number of stack frames in the call stack

CHOOSE

Return one of several values, based upon the value of an index

CODEPTR

Obtain a 32-bit address of a label, Sub or Function

DO/LOOP

Define a group of statements that are executed repetitively

EXIT

Transfer program execution out of a block structure

FOR/NEXT

Define a loop of program statements controlled by a counter

FUNCNAME$

Return the name of the current Sub, Function, Method, or Property

FUNCTION/END FUNCTION

Define a Function block

GOSUB

Invoke a local subroutine

GOSUB DWORD

Invoke a local subroutine indirectly

GOTO

Transfer program execution to the statement identified by a label

GOTO DWORD

Transfer execution indirectly to a local label or line number

IF

Test a condition and execute one or more program statements

IF/END IF

Create a IF/THEN/ELSE block with multiple lines and conditions

IIF

Return one of two values based upon a True/False evaluation

ISFALSE

Return the logical falsity of a given expression

ISMISSING

Determine whether an optional parameter was passed by the calling code.

ISNOTHING

Determine the current status of a given object variable

ISOBJECT

Determine the current status of a given object variable

ISTRUE

Return the logical truth of a given expression

ITERATE

Start an immediate iteration of a loop structure

MACRO

Define a single or multi-line text substitution block

METHOD/END METHOD

Define a METHOD procedure within a class

ON ERROR

Specify an error handling routine; enable/disable trapping

ON GOSUB

Call one of several subroutines based on a numeric expression

ON GOTO

Send program flow to one of several labels based on a value

PBMAIN

Define the initial entry-point Function for an application

PROFILE

Capture an execution time profile of the Subs, Functions, Methods, and Properties

PROPERTY/END PROPERTY

Define a PROPERTY procedure within a class

RETURN

Return from a (GOSUB) subroutine to its caller

SELECT CASE

Control program flow based on the value of an expression

SLEEP

Pause the current thread for a specified number of milliseconds

SUB/END SUB

Define a Sub (procedure) block

TRY/END TRY

A structured method of trapping and responding to errors

WHILE/WEND

Define a block of statements that are executed repeatedly

WINMAIN

Define the initial entry-point Function for an application