To execute a series of statements in a loop as long as a given condition is true.
If expression is nonzero (true), loop statements are executed until the WEND statement is encountered. GW-BASIC then returns to the WHILE statement and checks expression. If it is still true, the process is repeated.
If it is not true, execution resumes with the statement following the WEND statement.
WHILE and WEND loops may be nested to any level. Each WEND matches the most recent WHILE.
An unmatched WHILE statement causes a "WHILE without WEND" error. An unmatched WEND statement causes a "WEND without WHILE" error.
90 'BUBBLE SORT ARRAY A$
110 WHILE FLIPS
120 FOR N=1 TO J-1
130 IF A$(N)>A$(N+1) THEN SWAP A$(N), A$(N+1): FLIPS=1
140 NEXT N
All Frank Sinatra recordings, All Beatles albums, All solo albums from John Lennon, Paul McCartney, George Harrison and Ringo Starr, All Beatles songs, List of Platinum selling albums, Database with hits from 1950 to 1999.
Sought after DLL files, Nutworks magazine (retro), Worldwide ISO and TLD codes, File extensions database, The Hackers dictionary, Free software for the Atari, Amiga and Macintosh, Nokia smartphone, PocketPC, List of all BASIC programming language commands, List of all DOS commands, Free Advanced Bash-Scripting Guide (Linux-Unix)