[Coco] signal/intercept routine in Basic09

Wayne Campbell asa.rand at gmail.com
Sat Jan 23 17:22:58 EST 2010


It seems strange that Basic09 includes ON ERROR GOTO for trapping errors, but does not include something like ON SIGNAL, OR INTERCEPT, or ON BREAK  for trapping signals. Errors, not caught with ON ERROR GOTO cause Basic09 to drop into debug mode. Signals also cause Basic09 to drop into debug mode. Why aren't they trappable? I don't know.

I have been looking at F$Icpt. I have also looked in the C manual at intercept() and signal(). Since F$Icpt is the only system call I can find, and since signal() and intercept() are incompatible, I take that to mean both use the F$Icpt call, and deal with it differently.

Has anyone here ever written a signal trap or intercept routine for Basic09? Does anyone here have a clue how to write one? I need to be able to trap all signals that are not fatal to the process. Of course, there are some that cannot be trapped, and that's OK, so long as I can trap the rest.

Wayne



More information about the Coco mailing list