4-114 MELFA-BASIC V functions
4MELFA-BASIC V
*Related functions
(2) Repetition
Multiple command statements can be repeatedly executed according to the designated conditions.
*Command word
*Statement example
*Related functions
Function Explanation page
Repetition...........................................................................................
Page 114, "(2) Repetition"
Interrupt..............................................................................................
Page 115, "(3) Interrupt"
Subroutine..........................................................................................
Page 116, "(4) Subroutine"
External signal input...........................................................................
Page 118, "(1) Input signals"
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 113, "(1) Unconditional branching, conditional branching,
waiting"
Interrupt..............................................................................................
Page 115, "(3) Interrupt"
Input signal wait .................................................................................
Page 118, "(1) Input signals"