O'Reilly logo

Learn to Program with Small Basic by Ed Price, Majed Marji

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

14CREATING CONDITIONAL WHILE LOOPS

image

In Chapter 13, we showed you how to use the For loop to repeat code a certain number of times. For loops are ideal to use when you know exactly how many times you want to repeat code. While is another Small Basic keyword that lets you create loops. It’s useful when you don’t know how many times you want to repeat a loop in advance, because While loops keep running code as long as a condition is true.

A While loop condition is similar to how your parents keep telling you to clean your room until it’s spotless or how you keep eating Thanksgiving turkey until you’re stuffed! When the loop’s condition becomes false, ...

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