Reiterative Statements - KEP MMI-1500 Installation & Operation Manual

Mmi-touchscreen series
Table of Contents

Advertisement

14.4.3.2 Select-Case Statements
The Select Case is a specialized form of the If-Then-Else statement. It allows multiple comparisons to values.
The Syntax is as follows:
Select Case <Expression>
[Case <evaluation>]
[Statements]
[Case Else]
[Statements]
End Select
Syntax description:
Select Case
< Expression >
Case
< evaluation >
[Statements]
Case Else
End Select

14.4.4 Reiterative Statements

Reiterative statements control loops and repetitive tasks depending on conditions. There are two types of reiterative
statements.
14.4.4.1 For-Next Statements
The For-Next construction is for stepping through a fixed number of iterations. A variable is used as a counter to track
progress and test for ending conditions. Use this for fixed execution counts.
The Syntax is as follows:
For <Counter> = <StartValue> To <EndValue> [Step <Stepvalue> ]
or
For <Counter> = <StartValue> Down <EndValue> [Step <Stepvalue> ]
[Statements]
Next [counter]
Syntax description:
For
< Counter >
<StartValue>
To or Down
<EndValue>
Step
<StepValue>
[Statements]
Next
[counter]
Must be used to begin the statement
Required. This is the controlling expression. The result of evaluating the expression is
used as a test in the Case expressions.
Must precede the statements that evaluate the results of the Select Case <Expression>
This is the controlling statement for each Case. It is compared to the results of the Select
Case <Expression>. If it evaluates to TRUE then the statements below it are executed. If
fit evaluates to FALSE then the macro jumps to the next Case or Case Else.
Statements to execute when the evaluation is TRUE.
Must precede the statements to execute if none of the Cases evaluates to TRUE.
Must be used to end a Select Case.
Must be used to begin the statement
Required. This is the controlling variable. The result of evaluating the variable is used as
a test for completion.
Required. The < Counter >s initialized value.
This determines if the Step control increments or decrements the <Counter>. "To"
increments <Counter> by <Stepvalue>. "Down" decrements <Counter> by <Stepvalue>.
Required. The test point. If the < Counter >is greater than this value, the macro exits the
loop.
Optional keyword. Specifies that a <StepValue> other than one is to be used.
The value that < Counter > is changed every loop. If [Step <Stepvalue> ] keywords are
omitted the step value defaults to 1.
Statements to execute when the evaluation is TRUE. For-Next loops may be nested.
Must precede the statements to execute if none of the Cases evaluates to TRUE.
Optional < Counter > name. This is used when nesting For-Next loops.
186

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mmi-750Mmi-730Mmi-850

Table of Contents