🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.pc
Article #8513

Turbo Pascal and arguments

#8513
From: Brandon Allbery
Date: Fri, 24 Oct 1986 23:30
32 lines
2114 bytes
Quoted from <2444@gitpyr.gatech.EDU> ["Re: Argv[0] in TURBO PASCAL"], by jkg@gitpyr.gatech.EDU (Jim Greenlee)...
+---------------
| 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
| > I know it can be found.  I just don't know where in memory MS-DOS
| > keeps it.    Thanks in advance
| 
| Turbo Pascal does not support equivalent procedures to the argv()
| and argc() functions found in most C (and in some Pascal) libraries.
| To get at the command line from within Turbo, you have to address
| the memory location(s) where the command line is stored. The following
| (from Borland's "Turbo Tutor" book) will access arguments passed to
| a program:
+---------------

Turbo Pascal 3.0 has the functions:

function ParamCount : integer;
function ParamStr(argc : integer) : string[255];

The manual doesn't say whether ParamStr(0) is valid or not.

++Brandon
-- 
  ---------------- /--/	Brandon S. Allbery		UUCP: decvax!cwruecmp!
 /              / /|\/	Tridelta Industries, Inc.        ncoast!tdi2!brandon
----    -------- /-++	7350 Corporate Blvd.		PHONE: +1 216 974 9210
   /   / /---,  ----	Mentor, Ohio 44060		SYSOP: UNaXcess/ncoast
  /   / /    / /  /	     -- HOME --			 (216) 781-6201 24 hrs.
 /   / /    / /  /	6615 Center St. Apt. A1-105	ARPA:  ncoast!allbery%
----  -----~ ----	Mentor, Ohio 44060-4101		case.CSNET@relay.cs.net
Technical Details
Message-ID: <1628@ncoast.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbatt!cwruecmp!hal!ncoast!allbery
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!watmath!clyde!cbatt!cwruecmp!hal!ncoast!allbery
From: allbery@ncoast.UUCP (Brandon Allbery)
Newsgroups: net.micro.pc
Subject: Turbo Pascal and arguments
Message-ID: <1628@ncoast.UUCP>
Date: Fri, 24-Oct-86 18:30:10 EST
Article-I.D.: ncoast.1628
Posted: Fri Oct 24 18:30:10 1986
Date-Received: Sun, 26-Oct-86 02:10:18 EST
References: <623@A60.UUCP> <2444@gitpyr.gatech.EDU>
Reply-To: allbery@ncoast.UUCP (Brandon Allbery)
Followup-To: net.micro.pc
Organization: North Coast Public Access UN*X, Cleveland, OH
Lines: 32