O'Reilly logo

DarkBASIC Pro Game Programming, Second Edition by Joshua R. Smith, Jonathan S. Harbour

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Looping Statements

DarkBASIC has several types of loops, each of which has its own unique way of defining the starting and ending points of the loop. Each statement dictates a different starting and ending point for a loop. As I mentioned briefly at the beginning of the chapter, there are four looping statements in DarkBASIC:

  • FOR . . . NEXT

  • DO . . . LOOP

  • REPEAT . . . UNTIL

  • WHILE . . . ENDWHILE

The main difference among these statements is the condition each one uses to determine when the loop is finished. What is a condition? It is a programming statement that resolves to either a true or false answer. Each iteration through a loop is determined by a condition; if the condition is true, then the loop ends and the program continues. Table 5.1 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required