[Lazarus] Free Pascal ? (I Hope its not too OT)
Aleksa Todorovic
alexione at gmail.com
Sun Mar 14 15:09:23 CET 2010
Try
Uses Classes, Process, SysUtils;
:-)
On Sun, Mar 14, 2010 at 14:16, Terry A. Haimann <terry at haimannonline.com> wrote:
> This may seem like a stupid question, but is there an easy way to do this?
> Since these directories that all of these include files reside in arn't in
> my path statement and they arn't all in the same directory.
>
> Aleksa Todorovic wrote:
>>
>> 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
>>>
>>>
>>
>>
>>
>>
>
>
> --
> _______________________________________________
> 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