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

263 LOCAL Purpose This informs the computer that the named variables are ‘local’ to the procedure or function in which they occur; their use in this procedure or function in no way affects their value outside it. See the keyword DEF for more information. Example 560 LOCAL X,Y,A$,B$ Description A statement which can only be used inside a procedure or function definition. LOCAL saves the values of the external variables named and restores these original values when the function or procedure is completed.

Syntax LOCAL | {, | } Demonstration procedure 780 DEF PROCdrawTRIANGLE(size) 790 LOCAL X1,X2,Y1,Y2 800 X1=320-size 810 X2=320+size 820 Y1=256-size 830 Y2=256+size 840 MOVE X1,Y1 850 DRAW X2,Y1 860 DRAW 320,Y2 870 DRAW X1,Y1 880 ENDPROC Associated keywords DEF , ENDPROC , FN , PROC