[Coco] error trapping
Robert Gault
robert.gault at worldnet.att.net
Tue Dec 1 08:35:29 EST 2009
Wayne Campbell wrote:
> I need to know how to trap an error generated by the makdir command when it's being executed with a SHELL statement in a Basic09 subroutine. If I try to use it, and the directory already exists, the error is displayed on the screen, despite the fact that I am using a ON ERROR GOTO statement to trap it. Execution resumes in the correct location in the code, but I can't find anything in the OS-9 manual about suppressing error messages.
>
> Can anyone help?
>
> Wayne
>
>
Looks like the error is going to the Shell rather than back to Basic09.
You may be able to get the Shell command to ignore the error by using
the following syntax:
SHELL " -x makdir"+dirname
I've not tested this but if it works, the Shell will not make the
directory because it exists but will return to Basic09 rather than
halting on the error. Then it's a question of what you want your Basic09
program to do as it won't know an error occurred.
More information about the Coco
mailing list