BeSly Software Solutions About yab About us Admin




Name:

while -- start a while-loop

Synopsis:
 
while(...) 
  ... 
wend 

Description:
The while-keyword starts a while-loop, i.e. a loop that is excuted as long as the condition (which is specified in braces after the keyword while) evaluates to true.
Note, that the body of such a while-loop will not be executed at all, if the condition following the while-keyword is not true initially.
If you want to leave the loop prematurely, you may use the break-statement.

Example:
open #1,"foo" 
while(!eof(1)) 
	line input #1 a$ 
	print a$ 
wend 
Explanation:

This program reads the file foo and prints it line by line.



Related: until, break, wend, do