🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.commandlinetools
Article #82

Re: Commad Line question

#82
From: Thomas Mueller
Date: Sat, 05 Nov 2005 18:09
26 lines
1692 bytes
Hi,

Donald Neisler wrote:

> Never written a command line app and now I am and I have a question.

> I need to be able to use it like this.

> c:\temp\MyExe.exe %variable

Is %variable an environment variable? If Yes: Is your program called from
cmd.exe?

If you answer both questions with yes, just use ParamCount/ParamStr to read
the parameters. The shell will take care of expanding the environment
variable.

If your program is not called by cmd.exe but by another program that passes
the actual text "%variable" to it, your program must call
GetEnvironmentVariable to determine the value of the variable.

twm

ps: This group is meant for discussions about the commandline tools that
come with Delphi, e.g. dcc32, grep etc., not commandline tools written with
Delphi.
Technical Details
Message-ID: <436ba378@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4367b063@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: ff8f1,f0c155105405dc35
X-Google-Attributes: gidff8f1,public
X-Google-Language: ENGLISH,ASCII-7-bit
Message-ID: <436ba378@newsgroups.borland.com>
From: Thomas Mueller <spam@dummzeuch.de>
Subject: Re: Commad Line question
Newsgroups: borland.public.delphi.commandlinetools
Date: Sat, 05 Nov 2005 19:09:37 +0100
References: <4367b063@newsgroups.borland.com>
Lines: 27
User-Agent: KNode/0.8.2
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
NNTP-Posting-Host: 84.63.55.85
X-Trace: newsgroups.borland.com 1131127673 84.63.55.85 (4 Nov 2005 10:07:53 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail