Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!gatech!udel!udccvax1!udccpyr1!mikej From: mikej@pyr1.acs.udel.EDU (Michael Jacobs) Newsgroups: comp.lang.pascal Subject: Re: Programming ... Pascal Keywords: Pascal, Parameters Message-ID: <2936@udccvax1.acs.udel.EDU> Date: 27 Feb 89 20:24:00 GMT References: <495@chief.UUCP> <772@rpi.edu> Sender: usenet@vax1.acs.udel.EDU Reply-To: mikej@pyr1.acs.udel.EDU (Michael Jacobs) Organization: University of Delaware Lines: 20 In article <772@rpi.edu> fargo@pawl.rpi.edu (Ethan M. Young) writes: >In article <495@chief.UUCP> start@chief.UUCP (CompuInvest BBS system ) writes: >>How does one set up a program to read in parameters from the command line? >>Shell> pascal.prg -param1 -param2 > >In Turbo Pascal (at least 3.0), there are two variables called ParamCount and >ParamStr. ParamCount is of type integer and contains the number of blank- >separated parameters on the command line. > >ParamStr is an ARRAY of strings, each string being the appropriate parameter, >starting at index 1 (It may be 0) It's not an array, it's a function. It makes a difference wether you use ()'s or []'s. The parameter of the ParamStr function is the ordinal number of the parameter you want. ParamStr(0) will return the name of the program you executed. Mike J, The Grey Sysop... | Ancient Spirits of Evil, transform this Temporal Hitchhiker | decayed form into Mumm-ra, the Ever Living! mikej@vax1.acs.udel.EDU |