93 30 PROCNUM(X) 40 PRINT "OUT OF PROCEDURE J= ";J 50 NEXT X 60 END 70 DEF PROCNUM(K) 72 LOCAL X 75 FOR X= 1 TO 10 80 J=J + J/X 85 NEXT X 90 ENDPROC >RUN OUT OF PROCEDURE J= 275 OUT OF PROCEDURE J= 3025 OUT OF PROCEDURE J= 33275 OUT OF PROCEDURE J= 366025 OUT OF PROCEDURE J= 4026275 In the program above, X is used twice – once in the main program (lines 20 and 50) and secondly, and very differently, as a local variable in the procedure. J remains global. It is wise to declare variables as LOCAL in procedures and functions wherever possible except when the variable is a formal parameter. A formal parameter is automatically local and therefore does not need to be declared.