* Command line parameters problem...
@ 1995-10-29 4:00 Carl J. Lambrecht
1995-10-30 5:00 ` gezelter
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Carl J. Lambrecht @ 1995-10-29 4:00 UTC (permalink / raw)
I am having trouble getting command line parameters passed when running
an executable. The executable is a compiled C source code, which has the
necessary argc,argv code to handle a command line argument, but whenever
I try to run with my command line arguments:
run foo.exe 3500
I get an error on the 3500 stating that too many parameters have been
used, reenter command with less parameters. Is there a compiler or
linker flag which must be set to allow extra parameters? I am working on
a VAX 4100, running OpenVMS 6.1, and compiled using the standard DEC C
libraries, which appear to have all the C lib functions I need. What am
I missing?
Thanks in advance...
-Carl J Lambrecht
Kinesis Computing, Inc.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Command line parameters problem...
1995-10-29 4:00 Command line parameters problem Carl J. Lambrecht
1995-10-30 5:00 ` gezelter
@ 1995-10-30 5:00 ` Just me!
1995-10-31 5:00 ` Stephen Hoffman
1995-10-31 5:00 ` Lou Sanchez-Chopitea
3 siblings, 0 replies; 5+ messages in thread
From: Just me! @ 1995-10-30 5:00 UTC (permalink / raw)
To: cjlambre
"Carl J. Lambrecht" <cjlambre@mailbox.syr.edu> wrote:
>
>I am having trouble getting command line parameters passed when running
>an executable. The executable is a compiled C source code, which has the
>necessary argc,argv code to handle a command line argument, but whenever
>I try to run with my command line arguments:
> run foo.exe 3500
>I get an error on the 3500 stating that too many parameters have been
>used, reenter command with less parameters. Is there a compiler or
>linker flag which must be set to allow extra parameters? I am working on
>a VAX 4100, running OpenVMS 6.1, and compiled using the standard DEC C
>libraries, which appear to have all the C lib functions I need. What am
>I missing?
>
>Thanks in advance...
>-Carl J Lambrecht
> Kinesis Computing, Inc.
>
>
>
What you want to do is a classic VMS tutorial! B^) Allyagottadois...
Turn your command into a foreign command, thusly:
$ foo :== $<drive>:[account.some.where]foo.exe
Then, run it like this:
$ foo 3500
Then it'll work. Plus, you can do this into command procedures
that you can then run batch, if desired! Good luck, and have fun
with it!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Command line parameters problem...
1995-10-29 4:00 Command line parameters problem Carl J. Lambrecht
@ 1995-10-30 5:00 ` gezelter
1995-10-30 5:00 ` Just me!
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: gezelter @ 1995-10-30 5:00 UTC (permalink / raw)
In article <Pine.SOL.3.91.951029010748.24170A-100000-100000-100000@forbin.syr.edu>, "Carl J. Lambrecht" <cjlambre@mailbox.syr.edu> writes:
>
> I am having trouble getting command line parameters passed when running
> an executable. The executable is a compiled C source code, which has the
> necessary argc,argv code to handle a command line argument, but whenever
> I try to run with my command line arguments:
> run foo.exe 3500
> I get an error on the 3500 stating that too many parameters have been
> used, reenter command with less parameters. Is there a compiler or
> linker flag which must be set to allow extra parameters? I am working on
> a VAX 4100, running OpenVMS 6.1, and compiled using the standard DEC C
> libraries, which appear to have all the C lib functions I need. What am
> I missing?
>
> Thanks in advance...
> -Carl J Lambrecht
> Kinesis Computing, Inc.
>
>
--
Carl,
The correction is to define a "foreign command". For example, for the
example above:
$ foo :== $ SYS$LOGIN:FOO
Then, typing "FOO 3500" will function as desired.
I hope that the above is helpful, if I have been unclear, or can be of
further assistance, please feel free to contact me via Email or phone.
- Bob
+--------------------------------------------------------------------------+
| Robert "Bob" Gezelter E-Mail: gezelter@rlgsc.com |
| Robert Gezelter Software Consultant Voice: +1 718 463 1079 |
| 35-20 167th Street, Suite 215 Fax: (on Request) |
| Flushing, New York 11358-1731 |
| United States of America |
+--------------------------------------------------------------------------+
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Command line parameters problem...
1995-10-29 4:00 Command line parameters problem Carl J. Lambrecht
1995-10-30 5:00 ` gezelter
1995-10-30 5:00 ` Just me!
@ 1995-10-31 5:00 ` Stephen Hoffman
1995-10-31 5:00 ` Lou Sanchez-Chopitea
3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hoffman @ 1995-10-31 5:00 UTC (permalink / raw)
In article <Pine.SOL.3.91.951029010748.24170A-100000-100000-100000@forbin.syr.edu>, "Carl J. Lambrecht" <cjlambre@mailbox.syr.edu> writes:
:
:I am having trouble getting command line parameters passed when running
:an executable. The executable is a compiled C source code, which has the
:necessary argc,argv code to handle a command line argument, but whenever
:I try to run with my command line arguments:
: run foo.exe 3500
:I get an error on the 3500 stating that too many parameters have been
:used, reenter command with less parameters. Is there a compiler or
:linker flag which must be set to allow extra parameters? I am working on
:a VAX 4100, running OpenVMS 6.1, and compiled using the standard DEC C
:libraries, which appear to have all the C lib functions I need. What am
:I missing?
You're missing the discussion of foreign commands in the DEC C manual.
(Don't you hate it when that happens? :-) Prior to OpenVMS V6.2 and
the introduction of the DCL$PATH command path support, one had to set
up a foreign command in order to use C's argument-passing (argc and
argv) mechanism. ("Passing Arguments to the main Function" is the
heading in the _DEC C User's Guide for OpenVMS Systems_ manual.)
A foreign command is a DCL (global) symbol that equates to a full device,
directory and filename specification preceded by a "$" -- preceded by
the "this is a foreign command" indicator character.
eg: "fc :== $sys$sysdevice:[000000]imagename.exe"
The above C program can now retrieve the arguments via argc and argv.
(The OpenVMS V6.2 DCL$PATH support is far more convenient.)
------------------------------ Opinionative -------------------------------
Stephen Hoffman OpenVMS Engineering hoffman@xdelta.enet.dec.com
When encryption is outlawed, bayl bhgynjf jvyy unir cevinpl
---------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Command line parameters problem...
1995-10-29 4:00 Command line parameters problem Carl J. Lambrecht
` (2 preceding siblings ...)
1995-10-31 5:00 ` Stephen Hoffman
@ 1995-10-31 5:00 ` Lou Sanchez-Chopitea
3 siblings, 0 replies; 5+ messages in thread
From: Lou Sanchez-Chopitea @ 1995-10-31 5:00 UTC (permalink / raw)
In article <Pine.SOL.3.91.951029010748.24170A-100000-100000-100000@forbin.syr.edu>,
Carl J. Lambrecht <cjlambre@mailbox.syr.edu> wrote:
>
>I am having trouble getting command line parameters passed when running
>an executable. The executable is a compiled C source code, which has the
>necessary argc,argv code to handle a command line argument, but whenever
>I try to run with my command line arguments:
> run foo.exe 3500
>I get an error on the 3500 stating that too many parameters have been
>used, reenter command with less parameters. Is there a compiler or
>linker flag which must be set to allow extra parameters? I am working on
>a VAX 4100, running OpenVMS 6.1, and compiled using the standard DEC C
>libraries, which appear to have all the C lib functions I need. What am
>I missing?
You have to make the invocation a foreign command. Then everything will
work. It is run that is objecting to extra parameters. Good luck.
>
>Thanks in advance...
>-Carl J Lambrecht
> Kinesis Computing, Inc.
Cheers
Lou
--
Lou Sanchez-Chopitea EMail: lou.sanchez-chopitea@xilinx.com
Senior Software Engineer SnailMail: 2100 Logic Drive
SpeakMail: (408) 879-5059 San Jose, CA 95124
FaxMail: (408) 377-4790 #include <disclaimer.h>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1995-10-31 5:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-10-29 4:00 Command line parameters problem Carl J. Lambrecht
1995-10-30 5:00 ` gezelter
1995-10-30 5:00 ` Just me!
1995-10-31 5:00 ` Stephen Hoffman
1995-10-31 5:00 ` Lou Sanchez-Chopitea
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox