Qbasic Tutorial for beginners and children (Under Construction)

Creating loops

A loop is used to repeat a block of statement a certain number of times until a condition is met. There are 4 ways to execute loops in BASIC. 

  • The FOR NEXT statement
  • The DO LOOP statement
  • The WHILE WEND statement
  • The GOTO statement

The most popular are the FOR NEXT and DO LOOP statements.

Where are they used? Here are some examples:

  • In solving mathematic problems where you have to print a list of numbers which are incremented steadily.
  • In games where you have to monitor continuously for keyboard input or mouse input

[ Previous Index Next ]

pages viewed since January  19 2002