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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What kind of project?

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
What kind of new project should I select if I have an application that is only called by another application? I don't need any forms and the program only needs to run when it is called from the other program?

I need to be able to capture the parameters that the other program is passing, print a letter based on those parameters and that's it!

I've been looking at the Console and Service applications, but I'm not sure that's what I need.

Thanks!

Leslie
 
If the newer Delphis work the same as the old ones, all you would need is a regular app and to modify the DPR to handle the parameter passing, if you want the app locked into only accepting a certain # of parameters.

Say if you want the app to run only if one parameter is given:
Code:
if Paramcount <> 1 then
  begin
    Application.Initialize;
    Application.Title := 'Batch Patcher';
    Application.CreateForm(Tbatgui, batgui);
    Application.CreateForm(TAboutFrm, AboutFrm);
    Application.Run;
  end
else
  { message box, error code, etc }
;

Then when it comes time to need the parameter anywhere in your program:

Code:
myfilename := UpperCase(paramstr(1));

paramstr(0) is the full pathname to your app.
Paramstr(1-9) is each parm in order.
Use UpperCase() if you don't want case to matter in how the parm is presented in the program.
 
Ok, that's what I've done, I was thinking that there might be a better/different way....but I guess not.

Thanks for the input!

Les
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top