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, требуется в выкусить -to



Юрий Федоров   (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.026 c
1-22079
kserg@ukr.net
2001-12-19 13:11
2002.01.08
How to correctly associate a button with ToolBara with a menu item in MainMenu?


1-22093
Bristol
2001-12-19 11:59
2002.01.08
sending letters using Delphi 5


14-22385
moderator
2001-11-03 11:57
2002.01.08
> To Merlin - (SYSTRAY)


7-22422
savva
2001-09-19 12:42
2002.01.08
Интересная задачка... Как можно работая с сотовым через cом порт заставить его


6-22308
Igor
2001-10-14 09:44
2002.01.08
Data exchange between client and server in Delphi





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 Español 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