There are three main types of loops for QBasic. The loops are the While, Do Loop, and For loop. This tutorial will show the Do 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.
Do Loop Syntax
The Do Loop with the condition at the start of the loop.
Do (While/Until) [condition]
[Statement Block]
Loop
The Do Loop can have the condition at the end of the loop.
Do
[Statement Block]
Loop (While/Until) [condition]
Code Download
QBT10_1.BAS
QBT10_2.BAS
QBT10_3.BAS
QBT10_4.BAS
QB64 is a free download at www.qb64.com
QB64 Wiki & Manual is found at qb64.com/wiki.html
QBasic 1.1 comes with OldDOS. 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