Grayl1
asked on
open a txt witn an app
How to open for example a txt with an app in Delphi? I mean, you should right click with shift pressed on the txt and then choose open with... and then select my app in the list.
What source should this app contain?
Memo1.Lines.LoadFromFile(? ??);
What source should this app contain?
Memo1.Lines.LoadFromFile(?
ASKER
Rheingold...
Yes, U has understood me right.
I'm a bit new to Delphi so if you could give me an example...
Yes, U has understood me right.
I'm a bit new to Delphi so if you could give me an example...
ASKER
Rheingold...
Yes, U has understood me right.
I'm a bit new to Delphi so if you could give me an example...
Yes, U has understood me right.
I'm a bit new to Delphi so if you could give me an example...
To understand what Rheingolg means just drop a label1 in your application and do this:
label1.caption := '>' + getCommandLine + '<';
Double click on a txt file and you will see something like:
>c:\project1.exe c:\myfile.txt<
Another way is:
memo1.loadFromFile(paramst r(1));
in order to load the file.
label1.caption := '>' + getCommandLine + '<';
Double click on a txt file and you will see something like:
>c:\project1.exe c:\myfile.txt<
Another way is:
memo1.loadFromFile(paramst
in order to load the file.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hi,
GetCommandLine returns the commandline used to start program ie: project1.exe/ns
example:
edit1.text:=strpas(GetComm andLine);
what your after for this is paramstr() like below:
procedure TForm1.FormCreate(Sender: TObject);
begin
try
memo1.lines.loadfromfile(P aramStr(1) )
except
end;
end;
GetCommandLine returns the commandline used to start program ie: project1.exe/ns
example:
edit1.text:=strpas(GetComm
what your after for this is paramstr() like below:
procedure TForm1.FormCreate(Sender: TObject);
begin
try
memo1.lines.loadfromfile(P
except
end;
end;
oops shouldve pushed refresh first ;-)
listenning
ASKER
It works ;-)
Regards