From: MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 28-MAY-1992 08:09:21.26 To: info-vax@kl.sri.com CC: Subj: Re: SUMMARY: Case of the commandline-how do I get it? A late entry here.... A third command-line-grabbing technique which I haven't seen mentioned, is possible if you're programming in C. The argc and argv arguments to the main() function pick up command-line elements in a way slightly different from EITHER the "foreign" OR "native" command-verb-definition mechanisms. Specifically, where the "native" (.CLD, CLI$xxxx...) command mechanism forces all command-line input to UPPERCASE, the C RTL argc/argv forces everything to LOWERCASE. BOTH mechanisms will "preserve" the typed-in case of anything on the command line that was enclosed in double quotes ("), but the native-command mechanism will hand your application a string that INCLUDES the surrounding quotes -- forcing the application to strip/ parse these -- whereas the C RTL will NOT. If you're NOT programming in C, you might still be able to use the C RTL's facility for retrieving command-line information. I program in VAX MACRO assembly language, and tend to debug even high-level-language code at the instruction level, and have thus observed that VAX C obtains its arguments by a two-instruction sequence: moval -8(sp),sp ; Reserve eight bytes' dynamic storage jsb g^C$MAIN_ARGS ; Obtain command-line arguments After this sequence, the program's top-level argument stack has been changed to a three-entry argument list: argument 1 is C's "argc", by value; argument 2 is C's "argv", by reference (argument 2 is the address of a list of longwords, which in turn are pointers to argv[0], argv[1], etc. as null-terminated ASCII strings); argument 3 is another pointer, to an array identical in structure to the argv[] array but containing the primordial C "environment" strings, e.g. "HOME=...", "PATH=...", etc. etc... I don't know if this helps anyone, but I use it (though not in produc- tion code). Chris Chiesa Chris_F_Chiesa@cup.portal.com