187
14.4.4.2 While-Wend Statements
The While-Wend construction is for stepping through an unknown number of iterations. A variable is used to test for
ending conditions. When the condition is TRUE, the statements are executed repetitively until the condition becomes
FALSE.
Caution!
Care must be taken to avoid infinite loops. Infinite loops lock-up the MMI.
The Syntax is as follows:
While <Condition>
[Statements]
Wend
Syntax description:
While
Must be used to begin the statement
<Condition>
Required. This is the controlling statement. When it is TRUE the loop begins execution.
When it is FALSE the loop terminates.
[Statements]
Statements to execute when the evaluation is TRUE.
Wend
Indicates the end of the While-Wend statement.
14.4.5 Optional Keywords
These optional keywords can be used in statements to control macro execution.
Syntax description:
break
Used in For-Next, While-Wend or Select-Case blocks. It causes the macro to end the
block.
continue
Used in For-Next or While-Wend blocks. It ends the current iteration of the loop and
starts the next one.
return [value]
Ends the macro or function. The optional value can be a fixed number or a variable used
in the macro/function.
14.5 Macro Construction
A Macro is constructed in the following fashion:
Global Variable Declarations ..............................Optional
Sub Function Block Declarations........................Optional
Local Variable Declarations
[Statements]
End Sub
“Macro_Command main( )” ................................Required
Local Variable Declarations
[Statements]
“End Macro_Command” ....................................Required
14.5.1 Local and Global Variables
Local variables are used within the main macro function or in a defined function block. Its value remains valid only within the
specific block.
Global variables are declared before any function blocks and is valid for all functions in the macro. When local variables and
global variables have the same declaration names, only the local variables are valid.
Summary of Contents for MMI-1500
Page 2: ...ii...