[comp.lang.c] help with command-line arguements in Vax C

drack@titan.tsd.arlut.utexas.edu (Dave Rackley) (06/07/91)

> I am using Vax C (Version 3.0) and I have ran into a problem. After compiling my
>   program (which simply prints out the command-line arguements) and linking it, I
>   can't test it. When I try to pass the arguements, the 'run' command complains
>   about to many arguements (i.e is unwilling to do any passing.) Can someone tell
>   me what tom do?
>   Thanks,
>       Ken

This is not a C question, rather an OS (VMS) problem...nuff said, here's your
answer:

You need to create a "foreign" command with the following syntax from DCL:

   $ program_name :== $disk:[full.path.spec]program_name.exe {Press RETURN}

Now "run" your program by typing:

 program_name parameter1 parameter2 ...  


Hope this helps.


                      
--

  DISCLAIMER:  I, hereby, disclaim any disclaimer except this disclaimer.  

+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
| David Rackley                 | Now comes the really weird part...You know  |
| Applied Research Laboratories | the part where I know how to tap dance, but |
| The University of Texas       | only while wearing golf shoes...            |
| Austin, TX.  78758            |        ...Ponderous, man, really ponderous! |
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+

session@seq.uncwil.edu (Zack C. Sessions) (06/07/91)

kaarts@ccu.umanitoba.ca (Kenneth John Aarts) writes:

>I am using Vax C (Version 3.0) and I have ran into a problem. After compiling my
>program (which simply prints out the command-line arguements) and linking it, I
>can't test it. When I try to pass the arguements, the 'run' command complains
>about to many arguements (i.e is unwilling to do any passing.) Can someone tell
>me what tom do?

To run a VAX C program in which you expect to obtain and use the
command line arguments with the argc,argv contructs, you have to
run it in a special way. You have to create a "foreign command".
If this will be a program which you will run frequently, best to
do this in your LOGIN.COM:

$ cmdname :== $disk:[directory]progname

The cmdname need not be the same as the progname, it can be anything
you wish. You MUST either include the disk: and [directory] where
the executable is located or use a logical name which points to its
location. If you don't VMS will assume SYS$SYSROOT:[SYSEXE]. Also,
the syntax of the assignment operator is VERY important. It MUST be
COLON EQUALS EQUALS (:==). Then to use the command you would do a:

$ cmdname arg1 arg2

Remember that arg0 is the program name.

Zack Sessions
session@seq.uncwil.edu

glenn@zeus.ocs.com (Glenn Ford) (06/07/91)

In article <1991Jun6.165647.22250@ccu.umanitoba.ca> kaarts@ccu.umanitoba.ca (Kenneth John Aarts) writes:
>can't test it. When I try to pass the arguements, the 'run' command complains
>about to many arguements (i.e is unwilling to do any passing.) Can someone tell
>me what tom do?

You must define your program. On ours it would be as such:
testprog := $ocs$user:[glenn.src]testprog.exe

Then you just type 'testprog <args..>'

essential is:
testprog := $<drivename>:[path to source]progname