Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

How to read command line options Find similar branches


ProfiUgl   (2001-12-19 15:24) [0]

доброго дня суток МАСТЕРА!
Может быть кто-нубудь подскажет как считать параметры прокраммы в командной строке. Например я запускаю свое приложение: MyProg.exe -k, требуется в выкусить



Юрий Федоров   (2001-12-19 15:25) [1]

ParamStr, ParamCount



ProfiUgl   (2001-12-19 15:40) [2]

Спасибо понял!



oomneeq   (2001-12-19 15:45) [3]

А вот эта круче всех! :)

FindCmdLineSwitch

unit
Sysutils


type TSysCharSet = set of Char;

function FindCmdLineSwitch(const Switch: string; SwitchChars: TSysCharSet; IgnoreCase: Boolean): Boolean;

Description


Returns True if a specified string was passed as a command line argument.
TSysCharSet is a set containing special characters (e.g., "-" and "/" are common) that can be used to parse a string. The IgnoreCase parameter controls whether a case-sensitive or case-insensitive search is performed.

example


var s : string;
sc: TSysCharSet;

s:="help";
sc:=["/","-","|"];

// executed as: AppName.exe /help

if FindCmdLineSwitch(s,sc,False) then
ShowMessage("Application called with
HELP parameter!");


A source:
http://delphi.about.com/library/rtl/blrtlFindCmdLineSwitch.htm



Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top















Memory: 0.82 MB
Time: 0.032 c
1-22258
mashinist
2001-12-16 23:16
2002.01.08
Equation of the third degree.


6-22316
dmur
2001-09-24 20:58
2002.01.08
Interception of errors when connecting using sockets


14-22346
Ivan Shikhalev
2001-11-06 20:30
2002.01.08
Haiku :))


6-22268
Voha
2001-10-05 13:25
2002.01.08
There is no referer parameter in the WebBrowser component.


1-22183
XeN
2001-12-21 11:21
2002.01.08
DelphiX_play





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian spanish swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish