RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
System.ParamStr Function

Returns a specified parameter from the command-line.

Pascal
function ParamStr(Index: Integer): string;
C++
AnsiString ParamStr(int Index);

System

ParamStr returns the parameter from the command line that corresponds to Index, or an empty string if Index is greater than ParamCount. For example, an Index value of 2 returns the second command-line parameter.

Note: On Windows, ParamStr(0) returns the path and file name of the executing program (for example, C:\TEST\MYPROG.EXE).
Note: On Linux, ParamStr(0) returns the command used to execute the program, without parameters (for example, ./myprogram). This behavior is dependent on information returned by the shell program and may not be consistent among all shells.
Note: Use double quotes to wrap multiple words as one parameter (such as long file names containing spaces).
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!