Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
The WHILE...WEND statement is used to repeat a block of statements while the condition is met.
- condition is a numeric expression used to determine if the loop will execute.
- statements will execute repeatedly while condition is a non-zero value.
- EXIT WHILE can be used for emergency exits from the loop.
- Use _CONTINUE to skip the remaining lines in the iteration without leaving the loop.
- A DO...LOOP can use the same DO WHILE condition to get the same results.
- WHILE loops only run if the WHILE condition is True.
|=||Equal||IF a = b THEN|
|<>||NOT equal||IF a <> b THEN|
|<||Less than||IF a < b THEN|
|>||Greater than||IF a > b THEN|
|<=||Less than or equal||IF a <= b THEN|
|>=||Greater than or equal||IF a >= b THEN|
Example 1: Reading an entire file. Example assumes the program has a file opened as #1
Example 2: Clearing the keyboard buffer.