QBasic Tutorial 9 - While Loop - QB64



There are three main types of loops for QBasic. The loops are the While, Do Loop, and For loop. This tutorial will show the While loop.

WARNING
Make sure that the loop has a condition that will end the loop. If there is not a condition to end the loop, the computer will be sent through an infinite loop. Sometimes, using CTRL BREAK (QBasic 1.1) can end the infinite loop.

While Loop Syntax
WHILE [condition]
   [Statement Block]
WEND

Code Download
QBT9_1.BAS
QBT9_2.BAS
QBT9_3.BAS
QBT9_4.BAS
QBT9_5.BAS
QBT9_6.BAS
QBT9_7.BAS




QBasic / QB64 Links



QB64 is a free download at www.qb64.org

QB64 Wiki & Manual is found at www.qb64.org/wiki/Main_Page

QBasic 1.1 is found within OldDOS.exe.
OldDos is a free download at download.microsoft.com/download/win95upg/tool_s/1.0/W95/EN-US/olddos.exe

On some web browsers, the Microsoft link does not work, because the download comes as an exe file. A zip file of OldDOS can be found at www.pcxt-micro.com/download.html

QBasic 1.1 needs DOSBox to run on Windows Vista and greater, Mac, and Linux.
DosBox is a free download at www.dosbox.com

Free QB64/QBasic Code 

QBasic.Net - www.qbasic.net

Pete's QBasic Site - www.petesqbsite.com/index.php

QB45 - qb45.org

Phatcode - games.phatcode.net