[Lazarus] Free Pascal ? (I Hope its not too OT)

Marco van de Voort marcov at stack.nl
Mon Mar 15 12:46:47 CET 2010


On Sat, Mar 13, 2010 at 09:04:13PM -0600, Terry A. Haimann wrote:
>   StdStrLst   := TStringlist.Create;
>   ErrorStrLst := TStringlist.Create;
>   MyProcess := TProcess.Create(nil);
>   MyProcess.CommandLine := 'at now';
>   MyProcess.Options := MyProcess.Options + [poUsePipes];
>   MyProcess.Execute;
>   StdStrLst.Clear;
>   StdStrLst.Add('awk -F":" ''{print $1"\t"$3"\t"$4}'' /etc/passwd | sort');
>   StdStrLst.SaveToStream(MyProcess.Input);
>   StdStrLst.Clear;
>   StdStrLst.Add(chr(4));
>   StdStrLst.SaveToStream(MyProcess.Input);
> 
> Running this code from a Lazarus test program works with out any 
> problems.  When running it from a Free Pascal (non gui,) the program 
> seems to halt after issuing the "MyProcess.Execute;"  The program seems 
> to exit without any errors, but I have put writeln's throughout the code 

Maybe the main program is finished before the sub program has finished?




More information about the Lazarus mailing list