[Coco] error trapping

Wayne Campbell asa.rand at yahoo.com
Wed Dec 2 19:52:23 EST 2009


Robert,

I never thought about the shell options. All my routine needs to do, with this call is just skip to a different line, bypassing the create statement and continuing in the code. I am assuming it is an already exists error.

Thanks for the help. I'm going to look further into this option, and see what it reveals. I may be able to use it in other functions.

Wayne




________________________________
From: Robert Gault <robert.gault at worldnet.att.net>
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Sent: Tue, December 1, 2009 5:35:29 AM
Subject: Re: [Coco] error trapping

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.

--
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco



      


More information about the Coco mailing list