[Coco] error trapping

Lothan lothan at newsguy.com
Tue Dec 1 18:10:06 EST 2009


I think it would actually be easier to just call I$MakDir. This way you 
don't have to worry about the shell writing error messages or any other 
output to the console/window. The code should be something like this:

PROCEDURE MakDir
    TYPE Registers=CC,A,B,DP:BYTE; X,Y,U : INTEGER
    PARAM Path : STRING
    DIM Regs:Registers
    DIM CallCode:BYTE

    Regs.B = <attributes>
    Regs.X = ADDR(Path)
    CallCode = $85
    RUN SYSCALL(CallCode, Regs)
    REM Regs.B contains the error code or $00 if successful
END

--------------------------------------------------
From: "Wayne Campbell" <asa.rand at yahoo.com>
Sent: Tuesday, December 01, 2009 4:58 AM
To: <coco at maltedmedia.com>
Subject: [Coco] error trapping

> 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
>
>
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
> 



More information about the Coco mailing list