Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
type TSysCharSet = set of Char;
function FindCmdLineSwitch(const Switch: string; SwitchChars: TSysCharSet; IgnoreCase: Boolean): Boolean;
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.
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!');
|
Run with Parameters
How to pass command-line parameters to your Delphi application and how to handle them.
ParamCount,
CmdLine,
ParamStr
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|