mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 22:29:24 +01:00
24 lines
434 B
ObjectPascal
24 lines
434 B
ObjectPascal
{$mode objfpc}
|
|
{$h+}
|
|
|
|
program demoruncommand;
|
|
{
|
|
Demonstrate the RunCommand program.
|
|
|
|
Before running this demo program, compile the echoparams program first,
|
|
make sure both binaries are in the same directory.
|
|
}
|
|
|
|
uses sysutils, process;
|
|
|
|
Var
|
|
S : String;
|
|
|
|
begin
|
|
if RunCommand(ExtractFilePath(ParamStr(0))+'echoparams',['a','b','c'],S,[]) then
|
|
Writeln('echoparams returned : ',S)
|
|
else
|
|
Writeln('Command failed');
|
|
end.
|
|
|