87 17 Procedures The BBC Microcomputer has a very complete version of BASIC – often called ‘Extended BASIC’ and in addition it includes the ability to define and use procedures and functions. It is probably the first version of BASIC in the world to allow full procedure and function handling. These extremely powerful features enable the user to structure his or her programs easily and in addition provide a real introduction to other computer languages like PASCAL. A procedure is a group of BASIC statements which can be ‘called by name’ from any part of a program.
10 REM REACT 20 REM JOHN A COLL 30 REM BASED ON AN IDEA BY THEO BARRY, OUNDLE 40 REM VERSION 1/16 NOV 81 50 @%=&2020A 60 ON ERROR GOTO 470 70 MODE7 80 90 PROCINTRO 100 REPEAT 110 PROCFIRE 120 PROCSCORE 130 UNTIL FNSTOP 140 END 150 160 DEF PROCINTRO 170 PRINT "This program tests your reactions" 180 PRINT 190 PRINT "Press the space bar to continue" 200 REPEAT UNTIL GET=32 210 CLS 220 ENDPROC 230 240 DEF PROCFIRE 250 CLS 260 PRINT "Press the space bar" 270 PRINT "as soon as a cross appears" 280 T=TIME 290 R=RND(200)+100 300 REPEAT UNTIL TIME>T+R