4MELFA-BASIC V
MELFA-BASIC V functions
4-106
(2) Repetition
Multiple command statements can be repeatedly executed according to the designated conditions.
*Command word
*Statement example
*Related functions
Command word
Explanation
For Next
Repeat between For statement and Next statement until designated conditions are satisfied.
While WEnd
Repeat between While statement and WEnd statement while designated conditions are
satisfied.
Statement example
Explanation
For M1=1 To 10 ................................................................
:
Next
Repeat between For statement and Next statement 10 times.
The initial numeric variable M1 value is 1, and is incremented by one with each
repetition.
For M1=0 To 10 Step 2 .....................................................
:
Next
Repeat between For statement and Next statement 6 times.
The initial numeric variable M1 value is 0, and is incremented by two with each
repetition.
While (M1 >= 1) And (M1 <= 10) ......................................
:
WEnd
Repeat between While statement and WEnd statement while the value of the numeric
variable M1 is 1 or more and less than 10.
Function
Explanation page
Unconditional branching, branching...................................................
Page 104, "(1) Unconditional branching, conditional branching,
waiting"
Interrupt..............................................................................................
Input signal wait .................................................................................