🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3430

Re: Getting %1, %2, etc under Borland C

#3430
From: thomas.j.roberts
Date: Tue, 29 Sep 1992 14:38
21 lines
1503 bytes
From article <1992Sep28.184409.3571@mksol.dseg.ti.com>, by mccall@mksol.dseg.ti.com (fred j mccall 575-3539):
> In <1992Sep28.143744.1@wombat.newcastle.edu.au> c9106225@wombat.newcastle.edu.au (Matt McLeod) writes:
> 
> 
>>OK.  This has probably been asked zillions of times before, but I'll ask again
>>anyway...
> 
>>I'm trying to get ahold of the command line parameters (that is %1, %2, etc)
>>within a Borland C Windows program.  I've tried the getenv() function, but to
>>no avail, and there doesn't seem to be any other function around.

In Windows, the C startup code does not parse the command line (probably
because under Windows the command line is MUCH less important than under
MS-DOS). Thus, you need to parse it yourself, using the szCmdLine (or
whatever you actually call it) parameter to WinMain. getenv() has no
relation to command arguments, under either Windows or MS-DOS or UNIX.

To all the people who responded about arguments to main(...) - please
READ a posting before you respond.

Tom Roberts	att!ihlpl!tjrob		TJROB@IHLPL.ATT.COM
Technical Details
Message-ID: <1992Sep29.143827.9716@cbnewsc.cb.att.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!think.com!ames!haven.umd.edu!darwin.sura.net!convex!linac!att!cbnewsc!tjr
References: <1992Sep28.184409.3571@mksol.dseg.ti.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!think.com!ames!haven.umd.edu!darwin.sura.net!convex!linac!att!cbnewsc!tjr
From: tjr@cbnewsc.cb.att.com (thomas.j.roberts)
Subject: Re: Getting %1, %2, etc under Borland C
Organization: AT&T
Date: Tue, 29 Sep 1992 14:38:27 GMT
Message-ID: <1992Sep29.143827.9716@cbnewsc.cb.att.com>
References: <1992Sep28.184409.3571@mksol.dseg.ti.com>
Lines: 21