Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!mcnc!ecsgate!seq!session From: session@seq.uncwil.edu (Zack C. Sessions) Newsgroups: comp.lang.c Subject: Re: help with command-line arguements in Vax C Message-ID: <1634@seq.uncwil.edu> Date: 7 Jun 91 00:35:06 GMT References: <1991Jun6.165647.22250@ccu.umanitoba.ca> Distribution: na Organization: Univ. of North Carolina @ Wilmington Lines: 29 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