Solved

Command line switches

Posted on 2001-06-19
4
148 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 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