Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Fred Kleinsorge <kleinsorge@star.enet.dec_nospam.com>
Subject: Re: Specifying parameters to a C program?
Date: 1999/08/19	[thread overview]
Message-ID: <37BBF648.27E119F3@star.enet.dec_nospam.com> (raw)
In-Reply-To: 7pf1gt$g56$1@news.wrc.xerox.com

Kevin Lynn wrote:
> 
> I'm having trouble guessing how to specify command line parameters to a C
> program under VMS.
> 
> What I'd like to do is something like:
> 
> $run myprog -i param1 -a param2
> 
> so that -i, param1, -a, and param2 are passed to main() in the argv[].
> 
> Anyone know how to do this under VMS?


To make your VMS system act more like UNIX, define the logical name
DCL$PATH in your login.com file.  For instance:

$ define/nolog dcl$path [], sys$system

then when you type in an unknown command, DCL will search for an
executable image with the command name in the areas listed.  If it
doesn't find an executable, then it will look for a command file.  So
typing FOO will seach for []FOO.EXE and then SYS$SYSTEM:FOO.EXE, then
[]FOO.COM and SYS$SYSTEM:FOO.COM.

The traditional way to explicitly define a foreign command is to do:

$ foo :== $mydir:foo.exe

which creates a foreign command called foo.

In either case, argc and argv[] will contain the command line args (the
command line in argv[0], first argument parsed from white space in
argv[1], etc.

Note that unless you put an argument in quotes, everything is set to
lower case.



  parent reply	other threads:[~1999-08-19  4:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-18  4:00 Specifying parameters to a C program? Kevin Lynn
1999-08-19  4:00 ` sol gongola
1999-08-19  4:00 ` Richard Tomkins
1999-08-19  4:00 ` Fred Kleinsorge [this message]
1999-08-19  4:00 ` Adrian Birkett
1999-08-19  4:00 ` Arlen Williams
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox