Solved

Command line switches

Posted on 2001-06-19
4
143 Views
Last Modified: 2010-04-06
I need help creating a program that will accept command line switches. I do not have a clue where to begin

Any one got any pointers?


Steve
0
Comment
Question by:stephenarnott
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
geobul earned 50 total points
ID: 6205539
Hi,

See ParamCount and ParamStr functions.

Regards, Geo
0
 
LVL 8

Expert Comment

by:TOndrej
ID: 6205544
Also see FindCmdLineSwitch in SysUtils
0
 
LVL 17

Expert Comment

by:geobul
ID: 6205547
From Delphi help:

procedure TForm1.FormCreate(Sender: TObject);

var
  i: Integer;
  for i := 0 to ParamCount ? 1 do
  begin
    if LowerCase(ParamStr(i)) = 'beep' then
      Beep(10000,1000)
    else if (LowerCase(ParamStr(i)) = 'exit' then
      Application.Terminate;
  end;
end;

Regards, Geo
0
 

Author Comment

by:stephenarnott
ID: 6205689
Fast Answers always the best
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now