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

Aleksa Todorovic alexione at gmail.com
Sun Mar 14 08:27:17 CET 2010


Try including SysUtils in FreePascal version - it initializes
exception handling, so maybe there are some exceptions internally
happening which are not properly handled. Just a guess...


On Sun, Mar 14, 2010 at 04:04, Terry A. Haimann <terry at haimannonline.com> wrote:
> I tried to write a little utility to submit a command to the At Facility.
>
> The code to do this is as follows:
>
>  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 and I don't see any
> output after the above instruction.  It is probable that there is some
> errors in the stdout, but I never see them and don't know how to access it
> after the program exits.
>
> The Uses clause for the two apps are as follows.
>
> Lazarus:
>   uses Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics,
> Dialogs,
>  StdCtrls, Process;
>
> Free Pascal:
>   Uses Classes, Process;
>
> Anyone have any ideas?
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>



-- 
Aleksa Todorovic - Lead Programmer
Eipix Entertainment




More information about the Lazarus mailing list