Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site meccts.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!stolaf!umn-cs!meccts!ahby From: ahby@meccts.UUCP (Shane P. McCarron) Newsgroups: net.micro.apple Subject: Re: Need Help With Apple IIE Message-ID: <253@meccts.UUCP> Date: Fri, 1-Nov-85 18:39:32 EST Article-I.D.: meccts.253 Posted: Fri Nov 1 18:39:32 1985 Date-Received: Sun, 10-Nov-85 09:38:05 EST References: <170@srs.UUCP> <9800015@uiucuxa> Reply-To: ahby@meccts.UUCP (Shane P. McCarron) Organization: MECC Technical Services, St.Paul, MN Lines: 34 In article <9800015@uiucuxa> spk256@uiucuxa.CSO.UIUC.EDU writes: > >To trap out Ctrl-c's, all you have to do is use an >ONERR GOTO command somewhere in the beginning >of your command...the control c will be interpretted >as an "error" and will send the program to whatever >line number you told it to GOTO. > Unfortunately, this is a little misleading. Applesoft BASIC will leave a bunch of awful stuff on the stack when it jumps off to the error handler. This will cause terrible problems if you try to use the RESUME statement that apple has build in. In one of the early Applesoft BASIC manuals, there is a small assembly language program that you can call to clean up the stack. This may solve the problem, although I have never trusted it. There are also some locations in zero page that hold the location of the command that was being executed when the error occurred, as well as the stack pointer and some other information. These might be useful... Again, I don't think it would be infallible. The best scheme is to initialize your stack and restart the program if there is an error. Something like: 10 ON ERR GOTO 10000 ... 100 REM Main Program ... 10000 CALL 59415 : GOTO 100 : REM Call stkinit and restart the program. I hope this is a help. -- Shane P. McCarron Minnesota Educational Computing Corporation - Technical Services UUCP ihnp4!dicomed!meccts!ahby