Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

An application which takes a parameter

Status
Not open for further replies.

kristof

Programmer
Jun 2, 2000
234
BE
Hi all,

I would like to create a secondary program which I will be calling from the primary. To do this I will use a function called (eg) LoadExecute('filename', parameter).

Now, this means that the secondary application must be able to receive this parameter.

I was thinking to do this by adding a create constructor to the declaration of the Form:

constructor create(param:string);

Alas, I seem unable to make this work. X-)

Any suggestions?

Thx,

Kristof
 
Try ShellExecute() or WinExec()

Regards S. van Els
SAvanEls@cq-link.sr
 
In the main application, use ShellExecute() or WinExec() as svanels says.

In the destination application use ParamStr(1) (The first parameter),
or if you want to decode all parameters, use:

for i := 1 to ParamCount do
begin
s := ParamStr(i);
...
...
...
end; Andreas Nordlund
Software developer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top