' Ask for and input the length of time ' Do repeatedly: ' Ask the user for a note. ' Play it for the length of time. PRINT "Enter length of notes in ticks:" INPUT TIME DO PRINT "Enter the frequency (37-32000):" INPUT FREQ SOUND FREQ, TIME LOOP END
You have reached of this chapter. You may wish to review the following. Click on a term that interests you to go to where it was discussed.
DO...LOOP
in QBasic
SOUND
statement.
The next chapter examines using a counter with a loop. This enables your programs to keep track of how many times they have repeated something, and to decide when to stop. Soon you won't have to type CONTROL-BREAK to stop a loop!