Propeller Manual

Table Of Contents
REPEAT – Spin Language Reference
REPEAT
Command: Execute code block repetitively.
((PUB PRI))
REPEAT Count
Statement(s)
((PUB PRI))
REPEAT Variable FROM Start TO Finish STEP Delta
Statement(s)
((PUB PRI))
REPEAT (( UNTIL WHILE )) Condition(s)
Statement(s)
((PUB PRI))
REPEAT
Statement(s)
((UNTIL WHILE)) Condition(s)
Count is an optional expression indicating the finite number of times to execute
Statement(s). If Count is omitted, syntax 1 creates an infinite loop made up of
Statement(s).
Statement(s) is an optional block of one or more lines of code to execute repeatedly.
Omitting Statement(s) is rare, but may be useful in syntax 3 and 4 if Condition(s)
achieves the needed effects.
Variable is a variable, usually user-defined, that will be iterated from Start to Finish,
optionally by Delta units per iteration. Variable can be used in Statement(s) to
determine or utilize the iteration count.
Start is an expression that determines the starting value of Variable in syntax 2. If
Start is less than Finish, Variable will be incremented each iteration; it will be
decremented otherwise.
Finish is an expression that determines the ending value of Variable in syntax 2. If
Finish is greater than Start, Variable will be incremented each iteration; it will be
decremented otherwise.
Delta is an optional expression that determines the units in which to
increment/decrement Variable each iteration (syntax 2). If omitted, Variable is
incremented/decremented by 1 each iteration.
Page 188 · Propeller Manual v1.1