System.SysUtils.FindCmdLineSwitch

From RAD Studio API Documentation
Revision as of 16:27, 16 October 2011 by TestAccount (Talk | contribs)

Jump to: navigation, search

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.

  • Switch is a command-line parameter, typically provided by the ParamStr function.
  • Chars is the set of characters that distinguish switches from other parameters. If Switch is omitted, it defaults to '/' and '-'.
  • IgnoreCase determines whether case-insensitive character matching is used. The default is True.
  • Value returns the remaining characters of the argument, when Switch is the first character of the argument.
  • Switch values may be specified in the following ways on the command line:


Constant Value Mode
clstValueNextParam 0 -p Value
clstValueAppended 1 -p Value or -p:Value


Pass the SwitchTypes parameter to exclude either of these switch types (Switch may be 1 or more characters in length.).

See Also

Personal tools
Translations