Owner's manual

Publication 1746-RM001A-US-P
Execution Control and Interrupt Support Functions 8-19
Examples
Simple Subroutine
>1 REM EXAMPLE PROGRAM
>10 FORI=1TO5
>20 GOSUB 100
>30 NEXT I
>40 END
>100 PRINT I
>110 RETURN
READY
>RUN
1
2
3
4
5
READY
>
Nested Subroutine
>1 REM EXAMPLE PROGRAM
>10 FORI=1TO5
>20 GOSUB 100
>30 NEXT I
>40 END
>100 PRINT I,
>110 GOSUB 200
>120 RETURN
>200 PRINT I*I,
>210 GOSUB 300
>220 RETURN
>300 PRINT I*I*I
>310 RETURN
READY
>RUN
111
248
3927
41664
525125
READY
>