🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.pc
Article #8483

Re: Argv[0] in TURBO PASCAL

#8483
From: Ron Burns
Date: Thu, 23 Oct 1986 13:28
41 lines
1814 bytes
In article <2444@gitpyr.gatech.EDU> jkg@gitpyr.UUCP (Jim Greenlee) writes:
>In article <623@A60.UUCP> lee@A60.UUCP (Gene Lee) writes:

>>
>>    Can anyone tell me how to get the Program name ( the name the
>> program was called by ) from Turbo Pascal?  Lattice C does it so
>>Gene Lee           UUCP: ...ihnp4!{meccts,dayton,rosevax}!ems!A60!lee
>>Sperry Corporation     ATT:  (612) 635-6334
>
>Turbo Pascal does not support equivalent procedures to the argv()
>and argc() functions found in most C (and in some Pascal) libraries.



What Mr. Greenlee must have meant was:

The revision of Turbo Pascal I have does not support.....etc.

In fact, TP version 3.0 provides two functions of interest to this discussion.

 1. number_of_space_delimited_parameters := ParamCount;
		and
 2. parameter_string := paramStr(which_parameter_would_you_like); {1,2,3..}

   for a command line like :
C>progname 1 two 3

   paramcount returns --->3
   paramstr(1)        --->1 (ascii char)
   paramstr(2)        --->two (ascii chars)
   etc.

Now, How do you get the equivalent of paramstr(0), or the filename of the
program???

             Ron

-- 
Ron Burns
UUCP: ...caip|meccts|dicome|umn-cs!ncs-med!sx7000!A60!ron
                                                      
Technical Details
Message-ID: <627@A60.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!dayton!ems!A60!ron
References: <623@A60.UUCP> <2444@gitpyr.gatech.EDU>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!dayton!ems!A60!ron
From: ron@A60.UUCP (Ron Burns)
Newsgroups: net.micro.pc
Subject: Re: Argv[0] in TURBO PASCAL
Message-ID: <627@A60.UUCP>
Date: Thu, 23-Oct-86 09:28:46 EDT
Article-I.D.: A60.627
Posted: Thu Oct 23 09:28:46 1986
Date-Received: Fri, 24-Oct-86 16:27:59 EDT
References: <623@A60.UUCP> <2444@gitpyr.gatech.EDU>
Reply-To: ron@A60.UUCP (Ron Burns)
Organization: Sperry Corp. - Roseville, MN
Lines: 41