Am 17.01.2011 23:52, schrieb Bo Berglund:
On Thu, 13 Jan 2011 23:02:03 +0100, Bo Berglund
<[email protected]>  wrote:

On Thu, 13 Jan 2011 22:02:32 +0100, Sven Barth
<[email protected]>  wrote:

On 13.01.2011 21:47, Bo Berglund wrote:

Any pointers to how this can be done appreciated.



You could use TProcess for this (found in unit "process").

It's documentation is here:
http://www.freepascal.org/docs-html/fcl/process/tprocess.html

And on the Wiki are examples for using it:
http://wiki.lazarus.freepascal.org/Executing_External_Programs

I hope this helps you further (if not feel free to ask, of coures :) ).

Regards,
Sven

Thanks Sven!
This is exactly what I was looking for! :-)
Good examples too.


I have used this for my test program and there was an annoying thing
that I had to fix:
Whenever I call the Execute method a black console window pops up and
since I use pipes there is nothing shown in this window.

To stop this from happening I set the ShowWindow property to swoHIDE.


Include "poNoConsole" to the Options property of your TProcess instance. This should stop the window from appearing.

So far so good, but when I read the help on TProcess it says that this
property applies only to Windows. So what happens on Linux?
Will the console show up on screen then?
Or is it automatically hidden in Linux?

Can't test myself because I am on Windows XP.



Using the property Options from above this should work in a cross platform way.

Regards,
Sven

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to