Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sundc!seismo!uunet!munnari.oz.au!goanna!minyos!rxcob From: rxcob@minyos.xx.rmit.oz.au (Owen Baker) Newsgroups: comp.lang.pascal Subject: Re: Getting the command line args Message-ID: <6196@minyos.xx.rmit.oz.au> Date: 8 Nov 90 01:57:42 GMT References: <1611@umriscc.isc.umr.edu> <2416@oucsace.cs.OHIOU.EDU> <90Nov6.193651est.4323@image.me.utoronto.ca> <1621@umriscc.isc.umr.edu> Organization: RMIT Computer Centre, Melbourne Australia. Lines: 29 The following TP Pascal code segment returns the full command tail as a string. I have found this usefull when you want to access all the parameters as they were originally entered at the command line. As far as I know there is no Turbo routine to do this directly. <------- Cut here ------> USES dos; FUNCTION COMMAND_TAIL : string; {Returns the command tail from the PSP (Program Segment Prefix). The command tail is the remainder of the command line that invoked the current program after the programs name} var s : string; begin move (mem [PrefixSeg : $0080], s, mem [PrefixSeg : $0080] + 1); command_tail := s; end; {command_tail} BEGIN {test} writeln (command_tail); END. <-------- Cut here --------> +-------------------------------+-------------------------------------------+ | Owen Baker | Communication Services Unit | | rxcob@minyos.xx.rmit.oz.au | RMIT - Victoria University of Technology | | (61) (3) 660-2038 | Melbourne, Victoria, Australia | +-------------------------------+-------------------------------------------+