[Coco] Basic09 question
Robert Gault
robert.gault at worldnet.att.net
Sat Aug 19 09:53:18 EDT 2006
Bob Devries wrote:
> Does anyone know if you can trap the BREAK (ESC) key in Basic09?
>
> My experiments so far just seem to show that Basic09 just quietly quits
> the programme when you press BREAK.
>
> Can anyone give me some pointers?
Good question fir which I don't have a good answer.
Running NitrOS-9, Basic09 will not trap either BREAK or shift-BREAK. In
fast the original version of Basic09 won't even respond to the BREAK
key. Basic09 had to be patched for NitrOS-9 use. It is possible that the
patch does not vector the BREAK key correctly but the Basic09 manual
suggests otherwise.
"ON ERROR GOTO is effective only with non-fatal, run-time errors." In my
mind, errors 2 & 3 are fatal run time errors so would not have been
trapped by Basic09 under either OS-9 or NitrOS-9. That's not to say
trapping is impossible.
on error goto 1
loop
error 2
endloop
1 print err
The above will exit with 2 meaning that either there is no
discrimination in "on error goto" or "error 2" does not really create an
"error". I think that this may be a bug/feature in Basic09 that would
need extensive study of the source code to fix.
More information about the Coco
mailing list