Article 171536 of comp.os.vms: In article <5ner5k$pig$1@news.isc.rit.edu>, glp5941@osfmail.isc.rit.edu (Greg Pratt) writes: > -----BEGIN PGP SIGNED MESSAGE----- > > I am having a problem using CLI$DCL_PARSE that I hope people here can help > me with. I haven't found a lot of sample code in the VMS documentation > that's written in C. > > I have written a test program in C (it's based on a real one that I was > working on) that calls CLI$DCL_PARSE to figure out command-line qualifiers > and parameters. You can find the source for the example files (and brief > instructions on how to put it together) at: > > http://www.rit.edu/~glp5941/vmstestfiles.txt > > Here's the problem: If I run the verb TEST with qualifiers that the CLD > file says are correct, no problem. But if I do something "illegal" > ("TEST/PERM/TEMP" or "TEST/DUMMY" (/DUMMY isn't a recognized qualifier), > CLI$DCL_PARSE() will print an error message, and then print a stack dump. > Execution continues within my code, but I'm trying to figure out why > CLI$DCL_PARSE() would produce a stack dump without being told explicitly to > do so (a la SYS$SIGNAL()). > > I am compiling this with DEC C on an AXP system running VMS 6.2-1H3. > > What am I missing here? The CLI$ routine is signalling the error, In this case, most probably the warning: CLI$_IVQUAL. This "signalling" nature of the CLI$ routine is the default action and can not be turned off. What I've done in the past is to create a special condition handler that will recognize the CLI facility errors and output them as error messages and dismiss the condition if I want to remain within the program. There is an example of this in an old version of my SYMBOL program available from FTP.WKU.EDU. I suspect that you could get away with simply declaring LIB$SIG_TO_RET as a condition handler in your program. Because you say you wrote this with "C", I'm supplying the following simple ditty to demonstrate. This ditty calls CLI$DISPATCH. You could build a similar "jacket" routine around the other CLI routines: CLI$DCL_PARSE, CLI$PRESENT and CLI$GET_VALUE #include #include #include unsigned long cli_dispatch(); main() { unsigned long status; printf("calling cli()\n"); status = cli_dispatch(); printf("called cli()\n"); return( status ); } unsigned long cli_dispatch() { lib$establish( lib$sig_to_ret ); return ( cli$dispatch() ); } -- VAXman- VAXman@TMESIS.COM Behold, he travaileth with iniquity, and hath conceived mischief, and brought forth falsehood. He made a pit, and digged it, and is fallen into the ditch which he made. His mischief shall return upon his own head, and his violent dealing shall come down upon his own pate. -- Psalms 7:14-16 --