System.SysUtils.FindCmdLineSwitch
From RAD Studio API Documentation
Revision as of 16:27, 16 October 2011 by TestAccount (Talk | contribs)
Delphi
function FindCmdLineSwitch(const Switch: string; const Chars: TSysCharSet; IgnoreCase: Boolean): Boolean; function FindCmdLineSwitch(const Switch: string): Boolean; function FindCmdLineSwitch(const Switch: string; IgnoreCase: Boolean): Boolean; function FindCmdLineSwitch(const Switch: string; var Value: string; IgnoreCase: Boolean = True; const SwitchTypes: TCmdLineSwitchTypes = [clstValueNextParam, clstValueAppended]): Boolean; overload;
C++
extern DELPHI_PACKAGE bool __fastcall FindCmdLineSwitch(const System::UnicodeString Switch, const TSysCharSet &Chars, bool IgnoreCase)/* overload */;
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | System.SysUtils |
Description
Determines whether a string was passed as a command-line argument to the application.
FindCmdLineSwitch determines whether a string represents a command-line switch, based on the first character of the string.
-
Switchis a command-line parameter, typically provided by the ParamStr function. -
Charsis the set of characters that distinguish switches from other parameters. IfSwitchis omitted, it defaults to '/' and '-'. -
IgnoreCasedetermines whether case-insensitive character matching is used. The default is True. -
Valuereturns the remaining characters of the argument, whenSwitchis the first character of the argument. -
Switchvalues may be specified in the following ways on the command line:
Constant Value Mode clstValueNextParam 0 -p ValueclstValueAppended 1 -p Valueor -p:Value
Pass the SwitchTypes parameter to exclude either of these switch types (Switch may be 1 or more characters in length.).