Solved

Get Command Line Options

Posted on 2000-04-01
2
144 Views
Last Modified: 2010-04-04
How could I get commandline options for example if I was to run my program like this

project.exe /a /s

how could I get the /a and /s?
0
Comment
Question by:nafa2221
[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
2 Comments
 
LVL 7

Expert Comment

by:Motaz
ID: 2677324
ParamStr(1) and ParamStr(2)

If you want to know the number of passed parameters use ParamCount

Azzoz
0
 
LVL 7

Accepted Solution

by:
Motaz earned 50 total points
ID: 2677329
If you want to display all parameters in a memo do this:

- Drop a Memo
- Drop a Button and write this code in it's OnClick event:

var
  i: Integer;
begin
  Memo1.Clear;
  for i:= 1 to ParamCount do
   Memo1.Lines.Add(ParamStr(i));
end;

Motaz
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Making delphi communicate with a c# service 16 124
Delphi 2 77
select query - oracle 16 101
Slow Restore if incremental backups using RDiff.exe 4 39
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 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