88 310 PRINT TAB(17, 10);"+" 320 *FX 15,1 330 REPEAT UNTIL GET=32 340 DELAY=TIME-T-R 350 ENDPROC 360 370 DEF PROCSCORE 380 PRINT TAB(0, 22); 390 PRINT "You took "; DELAY/100;" seconds" 400 ENDPROC 410 420 DEF FNSTOP 430 PRINT "Do you want another go?" 440 REPLY$=GET$ 450 =(REPLY$="N") OR (REPLY$="n") 460 470 @%=&90A The program above shows how named procedures and functions can be used. The main part of the program is between line 90 and line 140. 90 PROCINTRO 100 REPEAT 110 PROCFIRE 120 PROCSCORE 130 UNTIL FNSTOP 140 END The program tests a person’s reactions by measuring how long it takes him or her to notice a cross on the screen.
As you will see from the section above, line 90 calls a procedure which gives an introduction. The procedure is called PROCINTRO and it produces the following on the screen. This program tests your reactions Press the space bar to continue Then the program repeats PROCFIRE and PROCSCORE until the user indicates that he or she does not wish to continue. PROCFIRE produces this: Press the space bar as soon as a cross appears + and PROCSCORE produces this: You took 2.03 seconds