Sign in Join
FPDoc Onlineexperiment

TProcess.Parameters property

Member of TProcesspublishedIn unit Process

Command-line arguments. Supersedes CommandLine.

Declaration

pascal
property Parameters: TProcessStrings read FParameters write SetParameters;

Description

Parameters contains the command-line arguments that should be passed to the program specified in Executable.

Commandline arguments should be specified one per item in Parameters: each item in Parameters will be passed as a separate command-line item. It is therefor not necessary to quote whitespace in the items. As a consequence, it is not allowed to specify multiple command-line parameters in 1 item in the stringlist. If a command needs 2 options -t and -s, the following is not correct:

With Parameters do
  begin
  add('-t -s');
  end;

Instead, the code should read:

With Parameters do
  begin
  add('-t');
  Add('-s');
  end;
Note that Parameters is ignored if either of CommandLine or ApplicationName is specified. It can only be used with Executable.
The idea of using Parameters is that they are passed unmodified to the operating system. On Windows, a single command-line string must be constructed, and each parameter is surrounded by double quote characters if it contains a space. The programmer must not quote parameters with spaces.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.