EARL V DUNNINGTON, JR
[address omitted]
Dear Bill,
I read your article TS 2068 PROGRAMMING IN THE ABSTRACT with great interest as we had previously discussed this problem. To me you have two problems:
1. Use of the BREAK key during asubroutine. 2. Switching the destination line number for the return from a subroutine.
Regarding problem 1:
The use of the BREAK key during a subroutine is really not a problem as you would have to break into subroutines 78 times before you would get an OUT OF MEMORY remark. To prove this type into your computer the followingprogram:
10 ON ERR GO TO 40: FOR N=1 TO 100
20 GO SUB 30
30 NEXT N
40 PRINT N
RUN the program and you will see that 78 GO SUBs without any RETURNs have been entered on the STACK before you get an error. The chances of using BREAK during subroutines while the program is running, this number of times is infinitesimal.
If however you wish the program to RETURN to a different Line if the BREAK is used during a subroutine, without leaving the return address on the stack, then this is a type 2 problem.
The following sample program may be the answer you want:
10 GO SUB 9900
20 ON ERR RESET : CLS : PRINT "program would continue": STOP
2000 ON ERR RESET : CLS : PRINT "menu at Line 2000 would appear": STOP
9900 ON ERR GO TO 9950: PRINT "Press CAPS SHIFT and BREAK or ENTER": PAUSE 0: RETURN : REM PAUSE used to give time to press break or enter
9950 PAUSE 30: POKE 25083,208: POKE 25084,7: POKE 25085,0: RETURN : REM PAUSE used so break key does not continue to operate
Dear Bill
Your sample routine in the right column of page 40 of the April 90 issue, does not work as listed. This one does.
490 INPUT "INPUT A$ or press ENTER";a$
500 LET z=4: REM item 4 selected from menu
510 IF z=4 THEN GO SUB 900
520 PRINT "program would continue": STOP
900 IF LEN a$<1 THEN POKE 25083,208: POKE 25084,7: POKE 25085,0: RETURN
910 PRINT a$;: RETURN
2000 PRINT "routine to use if A$ has no data"
You must POKE 25085 with the statement number in the Line to which you want to return. In this case a zero.
Best regards,
THANKS Earl. We’ve now out-smarted the STACK, which Timex never intended us to do. _BJ-
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.