🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #985

Re: Parameters with my program

#985
From: Michel Leunen
Date: Fri, 03 Mar 2006 20:39
27 lines
1778 bytes
RS wrote:

> my program is supposed to do this : progr.exe c:\file1.txt c:\file2.txt
> 
> I don't know how I include this 2 paramaters in my source code ! 
> my_function(file1,file2);

If your program is a console application, your main function has this 
signature:

int main(int argc, char* argv[])

argc tells you how many parameters there is on the command line
argv is an array containing those parameters argv[0] contains the first 
parameter, argv[1] the second and so forth.

If your application is a window application, look at ParamCount and 
ParamStr in the VCL help file.

Michel
-- 
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, BCC5.5.1 Web site:
http://www.leunen.com/
----------------------------------------
Technical Details
Message-ID: <4408a940$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <44088f93$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,dbc09343f1ee5a9
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Fri, 03 Mar 2006 21:39:56 +0100
From: Michel Leunen <nospam@noreply.please>
Organization: www.leunen.com
User-Agent: Thunderbird 1.5 (Windows/20051201)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.web
Subject: Re: Parameters with my program
References: <44088f93$1@newsgroups.borland.com>
In-Reply-To: <44088f93$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 81.246.230.126
Message-ID: <4408a940$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1141418304 81.246.230.126 (3 Mar 2006 12:38:24 -0700)
Lines: 27
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail