Date : Thu, 07 Sep 2006 23:11:43 +0100
From : jgh@... (Jonathan Graham Harston)
Subject: Re: Tube File Copying
>Message-ID: <060906005505@...>
> > So far so good...except that as soon as you trap an error
> > with ON ERROR, the programme counter forgets where you
You can do it with care restructuring of the program strucures. A
simple example is:
A%=-10
ON ERROR REPORT:PRINT
REPEAT
A%=A%+1
PRINT A%;
PRINT 10/A%
UNTIL A%>9
Also, remember that the whole stack is cleared - GOSUB, FOR,
REPEAT, PROC, FN, so you can't ENDPROC after an error. You need to
reenter any procedures after dealing with the error:
ON ERROR IF FNerr:PROCend
PROCaction
PROCend
:
DEFPROCaction
whatever
ENDPROC
--
J.G.Harston - jgh@... - mdfs.net/User/JGH
Spectrum Emulators - http://mdfs.net/Apps/Emulators/Spectrum