Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!purdue!decwrl!shlump.nac.dec.com!mountn.dec.com!minow From: minow@mountn.dec.com (Martin Minow) Newsgroups: comp.lang.c Subject: Re: Command line parameters with VAX C? Message-ID: <1194@mountn.dec.com> Date: 4 Jan 90 19:18:56 GMT References: <6808@lindy.Stanford.EDU> <1042@stsci.edu> <1191@mountn.dec.com> <2457@durer.cme.nbs.gov> Reply-To: minow@mountn.dec.com (Martin Minow) Followup-To: comp.sys.vms Organization: Digital Equipment Corporation Lines: 28 In article <2457@durer.cme.nbs.gov> chris@sunset.ncsl.nist.gov (Chris Schanzle) justifiably complains that my "define a foreign command" procedure is ugly and un-understandable. Too true. Just trust me. (:-) > >My solution was simple: compile it somewhere you expect it to stay >put and do a $dir command to get the full device and directory name >to build the following command (symbol?): > > $ prog :== $:[]program.exe > >[the "$" before is required. ".exe" suffix is optional.] > Permit me to elaborate slightly. f$environment("DEFAULT") is a sort of getenv() in the command language. DEFAULT is the current device:[directory] string and the single quotes control variable name evaluation. My command file is useful for one-off compilations. As Chris notes, executables that stay around should be stored in a consistent place and defined using a one-liner in your login.com file. In my case, I have a subdirectory [.bin] and a private logical BIN: that points to it. My login.com file then merely says: $ grep :== $bin:grep.exe (I would recommend always including the .exe because of the way logical name translation works on VMS). I've directed followups to comp.sys.vms so we stop boring the C folk with this trivia. Martin minow@thundr.enet.dec.com