WHILE is a loop start marker, WEND is a loop end marker. Use: WHILE <condition to let the loop run while true> code WEND Also, take note of the REPEAT/UNTIL loop. REPEAT is a loop start marker, UNTIL is a loop end marker. Use: REPEAT code UNTIL <condition to stop loop> Finally, use BREAK to break out of a loop. Please note that it will not automatically break out of all nested loops.