Path: utzoo!utgpu!water!watmath!clyde!att!pacbell!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!LBL.GOV!nagy%warner.hepnet
From: nagy%warner.hepnet@LBL.GOV (Frank J. Nagy, VAX Wizard & Guru)
Newsgroups: comp.os.vms
Subject: Re: CLI$DCL_PARSE Error Output Suppression
Message-ID: <880616063603.256033a0@LBL.Gov>
Date: 16 Jun 88 13:36:03 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The Internet
Lines: 32

> I am writing an application in which I would like to do DCL parsing,
> using CLI$xxx routines, CLI tables, etc.  I know how to do this.  The
> problem is in the way CLI$DCL_PARSE works.  If the command string it
> is parsing is erroneous, it spits out an error message (not unlike DCL
> error messages).  My application uses FMS; error messages printed to
> the screen (without using FMS calls) would mess up the display.
     
CLI$DCL_PARSE does not write the message to the screen; it just signals
the error and the traceback handler is writing onto the screen.  The
way to fix this problem is to write your own exception handler (see
Section 7 of the VAX/VMS Run-Time Library Routines Reference Manual)
to trap these messages.  Your exception handler can then either
toss them in the junk or be fancier and generate its own display
of the messages (in which case you also want to look at the $GETMSG
or $PUTMSG system service to translate the signal to text.  The
$PUTMSG service is the one being used by the traceback handler to
display the message you are objecting to; I have used $PUTMSG with
user-specified action routines to grab the text in my own exception
handlers and send it OPCOM - for instance).

The advantage of the exception handler is that it can handle only
those errors it understands and pass others (maybe like ACCVIO) on
to the traceback handler for some sort of final error message and
exit.  Also, you can establish your exception handler only for
the routine in which you call CLI$DCL_PARSE to better localize
its actions.

= Frank J. Nagy   "VAX Guru & Wizard"
= Fermilab Research Division EED/Controls
= HEPNET: WARNER::NAGY (43198::NAGY) or FNAL::NAGY (43009::NAGY)
= BitNet: NAGY@FNAL
= USnail: Fermilab POB 500 MS/220 Batavia, IL 60510