From: CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 17-MAY-1989 19:38 To: MRGATE::"ARISIA::EVERHART" Subj: Re: Command line arguements Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Tue, 16 MAY 89 21:41:20 PDT Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Tue, 16 May 89 21:19:21 PDT Received: by ucbvax.Berkeley.EDU (5.61/1.36) id AA00455; Tue, 16 May 89 19:58:41 -0700 Received: from USENET by ucbvax.Berkeley.EDU with netnews for info-vax@kl.sri.com (info-vax@kl.sri.com) (contact usenet@ucbvax.Berkeley.EDU if you have questions) Date: 16 May 89 21:40:54 GMT From: versatc!leadsv!laic!nova!darin@apple.com (Darin Johnson) Organization: Lockheed AI Center, Menlo Park Subject: Re: Command line arguements Message-Id: <553@laic.UUCP> References: <3633@udccvax1.acs.udel.EDU>, <7214@bsu-cs.bsu.edu> Sender: info-vax-request@kl.sri.com To: info-vax@kl.sri.com In article <7214@bsu-cs.bsu.edu> cfchiesa@bsu-cs.bsu.edu (Christopher Chiesa) writes: >2) If you want a CDU-created command to be active every time you log in, there >are two ways to do it: one, you can explicitly issue a SET COMMAND command for >each of your "custom" commands, every time you log in -- this takes some TIME, >usually. The other method consists of saving the SET COMMAND output as a >"compiled" command definition table in a FILE in your area, and do a SET >COMMAND/TABLE command on login; this skips the lengthy "compilation" step >and is faster, but has the drawback that if you use only your OWN command >table (I BELIEVE) you LOSE the "standard" table with all the normal DCL >commands in it! Ugh. The problem with these, is that the definitions don't show up in subprocesses, and are really annoying if you want to put them in sylogin (modifying dcltables here is a big no-no). So I sat down one day after hearing that it was possible to link in a command table, and read through some manuals in depth. It turns out that SET MESSAGE/OBJECT will create a .OBJ file that can be linked into your program. Then all you need to do is to get the command line, (lib$get_foreign), parse it (cli$dcl_parse), and then dispatch off of it (cli$dispatch). Then the routine specified in the .CLD file can process the command line arguments like normal. It was simple enough for me that all I had to do was to rename my main routine, and create a new 10-20 line main routine. I have only done this in C, but it should work for Pascal as easily. Darin Johnson (leadsv!laic!darin@pyramid.pyramid.com) We now return you to your regularly scheduled program.