Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!stiatl!cns From: cns@stiatl.UUCP (Chris Straut) Newsgroups: comp.lang.c Subject: Re: Command line parameters with VAX C? Summary: Cast .EXE as a foreign command. Message-ID: <8412@stiatl.UUCP> Date: 3 Jan 90 13:13:44 GMT References: <6808@lindy.Stanford.EDU> Reply-To: cns@stiatl.UUCP (Chris Straut) Organization: Sales Technologies Inc., "The Little Shop of Horrors..." Lines: 53 In article <6808@lindy.Stanford.EDU> LC.YRS@forsythe.stanford.edu (Richard Stanton) writes: >Using C on my PC, I can pass command line parameters to programs via >the simple: > >progname [parameter list] > >How do I pass command line parameters (file names etc) to a program under >this system? If I type > >run progname parmlist > >I get a message complaining that RUN is being given too many >parameters. HELP RUN is not too informative. > >Thanks > >Richard Stanton To get a VAX/VMS image to accept command line arguments you need to declare the executable as a foreign command. This is done as follows: FRED :== $ userdisk:[userdir]FRED.EXE - where FRED.EXE is the executable. Then the command line would look like the following: $ FRED parameter1 parameter2 ... where $ is the VAX/VMS prompt. FRED is now a symbol in your process table and can be examined by SHOW SYMBOL FRED. The '$' in the definition is required for declaring executables as foreign commands. These symbols can be used on command procedures as well, and save you from typing the '@' character each type. It is similar to the symbols used for executables. FRED :== @userdisk:[userdir]FRED.COM - where FRED.COM is the command proc. The command line would then look like the following: FRED parameter1 parameter2 ... All of your most commonly used commands could be declared in LOGIN.COM or a SYMBOLS.COM file to avoid keying in each type you start a VAX/VMS session. Hope this clears things up a little. -- Christopher Straut | Go Jackets!!!!! gatech!stiatl!cns Sales Technologies, Inc | 3399 Peachtree Rd, NE | Atlanta, GA (404) 841-4000 |