help with command-line arguements in Vax C

Zack C. Sessions session at seq.uncwil.edu
Fri Jun 7 10:35:06 AEST 1991


kaarts at 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 at seq.uncwil.edu



More information about the Comp.lang.c mailing list