|
FOR I% = 1 TO 6 PROC1 PROC2 NEXT I% END DEF PROC1 PRIVATE !376, initdone% IF NOT initdone% THEN RESTORE +1 initdone% = TRUE ENDIF READ A$ PRINT A$ ; ENDPROC DATA The, five, boxing, wizards, jump, quickly. DEF PROC2 PRIVATE !376, initdone% IF NOT initdone% THEN RESTORE +1 initdone% = TRUE ENDIF READ A$ PRINT TAB(30) A$ ENDPROC DATA Jackdaws, love, my, big, sphinx, of quartz.
|
PRIVATE !376, initdone% : REM Make the data pointer private, and ... REM ... create a private Boolean to flag that the procedure has been called IF NOT initdone% THEN REM If this is the first time the procedure was called ... RESTORE +1 : REM ... set the data pointer to the next DATA statement ... initdone% = TRUE : REM ... and flag that the procedure has been called. ENDIF
|
|