Command line parameters with VAX C?

Chris Straut cns at stiatl.UUCP
Thu Jan 4 00:13:44 AEST 1990


In article <6808 at lindy.Stanford.EDU> LC.YRS at 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    |



More information about the Comp.lang.c mailing list