Thread View: borland.public.cppbuilder.internet.web
4 messages
4 total messages
Started by RS
Fri, 03 Mar 2006 18:52
Parameters with my program
Author: RS
Date: Fri, 03 Mar 2006 18:52
Date: Fri, 03 Mar 2006 18:52
20 lines
1418 bytes
1418 bytes
Hi, I would like initially to thank the people who answer in theses newsgroups, and in particular Remy , because they enabled me to advance on my project which traine since weeks! I am perhaps not in the good newsgroup , my question is : I have created a program : prog.exe with Borland C++ Builder. My program is supposed to copy files (like xcopy.exe of ms-dos), with two parameters : file1 and file2. 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); Many thanks ;)
Re: Parameters with my program
Author: Michel Leunen
Date: Fri, 03 Mar 2006 20:39
Date: Fri, 03 Mar 2006 20:39
27 lines
1778 bytes
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/ ----------------------------------------
Re: Parameters with my program
Author: RS
Date: Fri, 03 Mar 2006 20:41
Date: Fri, 03 Mar 2006 20:41
48 lines
1950 bytes
1950 bytes
Sorry,
I'm finding !!! the function ParamStr() !!!! Thanks ;)
Happy week-end !!!
and dot not to forget :
//-----------------------------
void Thanks_to_Remy()
{
int number=1;
while(number==1)
{
thanks (Remy,Gambit);
}
}
//-----------------------------
lol
;)
"RS" <rs.reloaded@wanadoo.fr> a �crit dans le message de news:
44088f93$1@newsgroups.borland.com...
>
> Hi,
>
> I would like initially to thank the people who answer in theses
> newsgroups, and in particular Remy , because they enabled me to advance on
> my project which traine since weeks!
>
> I am perhaps not in the good newsgroup , my question is :
>
> I have created a program : prog.exe with Borland C++ Builder.
>
> My program is supposed to copy files (like xcopy.exe of ms-dos), with two
> parameters : file1 and file2.
>
> 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);
>
> Many thanks ;)
>
Re: Parameters with my program
Author: John Smith
Date: Tue, 07 Mar 2006 08:02
Date: Tue, 07 Mar 2006 08:02
89 lines
2876 bytes
2876 bytes
Hello RS.
I use it in my program and it works:
#include <vcl.h>
void __fastcall TBrowse::FormCreate(TObject *Sender)
{
Browse->Table1->TableName = LowerCase(ParamStr(1));
Browse->Table1->Active = true;
}
or in the main program:
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
AnsiString Test;
Test = LowerCase(ParamStr(1));
if ( ExtractFileExt ( Test ) == ".dbf" )
{
Application->CreateForm(__classid(TBrowse), &Browse);
Application->Run();
}
else
{
Application->CreateForm(__classid(TForm1), &Form1);
Application->Run();
}
"RS" <rs.reloaded@wanadoo.fr> schrieb im Newsbeitrag
news:4408a8fa@newsgroups.borland.com...
> Sorry,
>
> I'm finding !!! the function ParamStr() !!!! Thanks ;)
>
> Happy week-end !!!
>
> and dot not to forget :
>
> file://-----------------------------
> void Thanks_to_Remy()
> {
> int number=1;
>
> while(number==1)
> {
> thanks (Remy,Gambit);
> }
> }
> file://-----------------------------
>
> lol
>
> ;)
>
>
> "RS" <rs.reloaded@wanadoo.fr> a �crit dans le message de news:
> 44088f93$1@newsgroups.borland.com...
> >
> > Hi,
> >
> > I would like initially to thank the people who answer in theses
> > newsgroups, and in particular Remy , because they enabled me to advance
on
> > my project which traine since weeks!
> >
> > I am perhaps not in the good newsgroup , my question is :
> >
> > I have created a program : prog.exe with Borland C++ Builder.
> >
> > My program is supposed to copy files (like xcopy.exe of ms-dos), with
two
> > parameters : file1 and file2.
> >
> > 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);
> >
> > Many thanks ;)
> >
>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads