Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!hp4nl!ruuinf!ruunsa!nboogaar From: nboogaar@ruunsa.fys.ruu.nl (Martin v.d. Boogaard) Newsgroups: comp.lang.c Subject: Re: Command line parameters with VAX C? Summary: Command line pars to Vax/VMS CC code Message-ID: <469@ruunsa.fys.ruu.nl> Date: 3 Jan 90 08:17:20 GMT References: <6808@lindy.Stanford.EDU> Organization: University of Utrecht, Dept. of Physics Lines: 43 There are two ways to do the job. 1. Use argc and argv like you do on any other system. You saw that you can't type RUN MYCODE PAR1 PAR2 because RUN expects only the name of the executable it should load. The simple solution is to define (e.g. in LOGIN.COM) MYC*ODE :== $MYCODE which enables you to simply enter MYCODE PAR1 PAR2 2. The complicated way is to use the Command Definition Utility (CDU) to install a command MYCODE that takes two parameters and runs MYCODE.EXE . You can specify default values and options and check whether parameter values are filenames or numbers etc. I use this to parse command line parameters to Pascal code because in VAX Pascal there is no such thing as argv . You have to use the routines CLI$PRESENT and CLI$GET_VALUE to find out about the values of your command line parameters. Off course the parameters off these system routines are passed by means of the usual string descriptor, which means you'll have to define a structure to match the VMS definition off this descriptor. Solution #1 is quick and will solve many problems, #2 is very non-portable, rather time consuming, but is to be preferred if you don't want your code to do the initial parameter checking. Contact me directly if you need examples of the use of CDU or the application of CLI$... Martin J. van den Boogaard Dept. of Atomic & Interface Physics, Rijksuniversiteit, Utrecht P.O. Box 80.000 DecNet: ruunsc::boogaard NL-3508 TA Utrecht BitNet: boogaard@hutruu51.bitnet the Netherlands internet: nboogaar@fys.ruu.nl +31 30 532904