Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!ucsd!telesoft!rlk From: rlk@telesoft.UUCP (Bob Kitzberger @sation) Newsgroups: comp.lang.pascal Subject: Re: Help with VAX Pascal Summary: Yet another command line passing mechanism Keywords: pascal vms Message-ID: <323@telesoft.UUCP> Date: 15 Oct 88 04:05:29 GMT References: <5900@june.cs.washington.edu> <5214@juniper.uucp> <21670@cornell.UUCP> Organization: TeleSoft Inc., San Diego, CA Lines: 40 Barry B Werger writes: > Does anyone know how to receive a command-line parameter in VAX Pascal? Three methods have been proposed : o LIB$GET_FOREIGN (passed as a single non-parsed string) o CLI$ routines (conforming to VMS syntax) o GETARGS (or somesuch package for mimicking UNIX argv/argc) Here's another. It's been a little while, and UNIX has since wreaked havoc with my once-VMS brain, so bear with the ambiguity ;-) A quick & dirty method (that is also rather flexible) is to have a small DCL command procedure that copies the DCL parameters P1 P2 ... P9 to symbols, and then executes your Pascal program. $ FILEIN :== P1 $ FILEOUT :== P2 $ BLAT :== P3 $ RUN PASCAL_STUFF etc. Then, use LIB$GET_SYMBOL in your Pascal program to extract the string values of the parameters FILEIN, FILEOUT, and BLAT into string variables. Sorry I can't provide proper syntax. The DCL shell approach also allows you to perform checking for existence of FILEIN, mount tapes, etc. - things that are less elegant in Pascal. Good luck! .Bob. -- ------------------------------------------------------------------------------ Bob Kitzberger Internet : telesoft!rlk@ucsd TeleSoft uucp : ...!ucsd.ucsd.edu!telesoft!rlk 5959 Cornerstone Ct. West at&t : (619) 457-2700 x163 San Diego, CA 92121-9891 "Nuclear weapons can wipe out life on earth, if used properly" -- Talking Heads ------------------------------------------------------------------------------