Sign in Join
FPDoc Onlineexperiment

StrToCmdLineParam function

In unit LazFileUtils

Ensures that whitespace and quoting in the specified string are valid for use in command line parameters.

Declaration

pascal
function StrToCmdLineParam(const Param: string): string

Description

The following actions are performed for values in the Param argument:

  • An empty string is converted to ''.
  • Values separated by space characters are enclosed by Quote (') characters.
  • An existing Quote (') character causes the value to be enclosed by Double Quote (") characters.
  • An existing Double Quote character causes a value to be enclosed by Quote characters.
  • A null byte (#0) causes the remainder of the Param value to be discarded.

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.