Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF (EN)

204 1040 B$=MID$(A$,d%,1)+B$ 1050 NEXT d% 1060 =B$ Third example – program section Multi-line procedure with one parameter. 200 DEF PROCbye(X) 210 REM print bye X times 220 LOCAL K 230 FOR K=1 TO X 240 PRINT "bye" 250 NEXT K 260 ENDPROC Fourth example – program section 10 DEF PROCINITSCREEN(X) 20 REM clear screen and draw border 25 COLOR 128+X 30 CLS 40 DRAW 1279,0 50 DRAW 1279,799 60 DRAW 0,799 70 DRAW 0,0 80 ENDPROC This sets the background colour to a new value given in the parameter.

Fifth example - full program 110 INPUT X,Y,Z 120 M=FNMEAN(X,Y,Z) 130 PRINT "The mean of ",X,Y,Z 140 PRINT "is ";M 150 END 8990 REM Single line numeric function 8995 REM with three parameters 9000 DEF FNMEAN(A,B,C)=(A+B+C)/3 Description A program object which must precede declaration of a user function or procedure. String and numeric functions and procedures may be defined. Multi-line functions and procedures are allowed. All procedures and functions must be placed in the program where they will not be executed, eg after the END statement.