User Manual
MCP Series
Brushed DC Motor Controllers
MCP Series User Manual
158
DO - WHILE
Syntax
do program statements while condition
• Statements - any group of commands to be run inside the loop.
• Condition - can be a variable or expression
Description
The DO - WHILE loop executes commands nested inside of it while some condition is true. The
condition can be any variable or expression that is tested every loop until it is false. Zero (0) is
false, not zero (0) is true. By default DO - WHILE will test this condition. The loop will continue
until its value equals zero (0). DO - WHILE will always run at least once since the condition is
checked at the end of the loop. Multiple DO - WHILE commands can be nested within each other.
However you can not nest DO - WHILE with a WHILE - WEND together.
temp var long
main
temp = 0;
do
puts 0,[dec temp,13]
temp = temp + 1
pause 100
while(temp<10);
goto main