On 17 Oct 2003 at 7:36, Frank Heckenbach wrote:
[...]
Compile this to `foo[.exe]':
program Foo;
var i: Integer;
begin for i := 1 to ParamCount do WriteLn (ParamStr (i)) end.
Then run this (might have to write 'foo.exe' in the `PExecute' call):
program Bar;
uses GPC, Pipe;
var Arguments: array [0 .. 2] of CString = ('foo', 'bar', '"bar"'); Status: Integer = 0; ErrMsg: TString = '';
begin PWait (PExecute ('foo', PCStrings (@Arguments), ErrMsg, PExecute_One), Status, 0); WriteLn (Status, ' ', ErrMsg) end.
The output should be:
bar "bar" 0
This is the output that I get:
bar "bar 0
Best regards, The Chief --------- Prof. Abimbola Olowofoyeku (The African Chief) Web: http://www.bigfoot.com/~african_chief/