From 1e5ffb1bafcd3c9d02fb4d09d723d2dcf33e5e43 Mon Sep 17 00:00:00 2001 From: dsiders Date: Sun, 23 Jan 2022 19:20:33 +0000 Subject: [PATCH] Docs: LazUtils/utf8process. Updates topic content. (cherry picked from commit c111b7caf5f2ef04723c824c0ab76a663fe29275) --- docs/xml/lazutils/utf8process.xml | 34 ++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/docs/xml/lazutils/utf8process.xml b/docs/xml/lazutils/utf8process.xml index 9e5203d85a..5be8601dd8 100644 --- a/docs/xml/lazutils/utf8process.xml +++ b/docs/xml/lazutils/utf8process.xml @@ -12,6 +12,9 @@

utf8process.pp implements the TProcessUTF8 component which provides a TProcess descendant that allows UTF-8-encoded values in its properties. The TProcessUTF8 component is added to the System tab in the Lazarus IDE Component Palette.

+

+ This file is part of the LazUtils package. +

@@ -96,7 +99,7 @@ Starts execution of the process.

- Execute is an overridden method in TProcessUTF8, and is defined only for the Microsoft Windows platforms. Execute handles the nuances of configuring and executing a call to CreateProcessW in the Windows API. + Execute is an overridden method in TProcessUTF8, and is defined only for the Microsoft Windows platforms where poDetached in not available as a process option. Execute handles the nuances of configuring and executing a call to CreateProcessW in the Windows API.

The values in ApplicationName, CommandLine, and Executable are checked to ensure that they contain non-empty values. An EProcess exception is raised if any of these properties contain an empty string (''). @@ -151,7 +154,7 @@ ParseCmdLine creates an internal TStringList instance used to store values returned from the SplitCmdLineParams routine in lazfileutils.pas. The first value in the string list (when present) is stored in the Executable property. The remaining values are stored in the Parameters property.

- ParseCmdLine is provided as a convenience method. An equivalent operation can be performed using the values in Executable and Parameters properties. + ParseCmdLine is provided as a convenience method. The same result can be achieved by setting the values in the Executable and Parameters properties directly.

@@ -171,30 +174,37 @@ Executes a command found in the current PATH environment.

- RunCmdFromPath is used to execute a command which can be found in the current PATH environment. For example, the following locates and executes the /bin/ls command with the specified arguments: + RunCmdFromPath is used to execute a command which can be found in the current PATH environment. For example, the following locates and executes the /bin/ls -l /home command:

RunCmdFromPath('ls', '-l /home');

- An exception will be raised if the program file cannot be located, or cannot be executed. + An exception is raised if the program file cannot be located, or cannot be executed.

- RunCmdFromPath creates an instance of TProcessUTF8 to execute the process. The value in ProgramFilename is surrounded by Quotation Mark (") characters if it contains a Space (' ') in the path or file name. RunCmdFromPath calls the Execute method to perform the process using the specified arguments. + RunCmdFromPath creates and configures a TProcessUTF8 instance which is used to execute the program file. ProgramFilename contains the qualified executable file name for the process. If the argument contains a Space (' '), it is surrounded by Quotation Mark (") characters before it is assigned to the class instance. CmdLineParameters contains optional parameters values for the executable file. It is assumed that parameter values with embedded spaces are already quoted when passed to the routine. CmdLineParameters is included in the class instance when the value is not an empty string (''). +

+

+ RunCmdFromPath calls the Execute method in the TProcessUTF8 instance to execute the specified program file name with the specified parameter values.

EFOpenError
- Raised with the message in lrsProgramFileNotFound -
-
EFOpenError
-
- Raised with the message in lrsCanNotExecute + Raised with the message in lrsProgramFileNotFound or lrsCanNotExecute.
+ @@ -206,10 +216,10 @@ - Name of the program to execute. + Path and name for the program executed. - Command line parameters for the process. + Command line parameters for the program.