Avisaro Online Documentation - Wiki
Impressum Kontakt Sitemap

WHILE

Description

A WHILE loop is one of two BASIC's standard head-controlled loop constructs. Such a loop starts with the keyword WHILE and ends with WEND. WHILE loops evaluate an expression before each iteration. If that expression evaluates to true, then the loop body is executed. Otherwise, the loop is left.   

Example

This example demonstrates a little counter with a WHILE loop:

outmode -2
let a = 1
while a < 11
   print a
   let a = a + 1
wend

Remarks

GOSUB, another WHILE loop or other loop types (such as FOR...NEXT) can be used from within a WHILE loop.