[fpc-pascal] run pascal programs as scripts

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Thu Mar 31 14:07:59 CEST 2011



On Thu, 31 Mar 2011, Darius Blaszyk wrote:

>
> On Mar 31, 2011, at 10:37 AM, michael.vancanneyt at wisa.be wrote:
>> Do yourself a favour, and use ExecuteProcess from the sysutils unit for your
>> Exec routine. It has all you need. The use of pipes is not needed when
>> running the program, it will only seriously slow the running of the program.
>>
>> But do not replace the unix fpexecv call; There will always be a difference
>> between Windows and Unix.
>
> This simplifies things quite a bit. Thanks for the hint. Here's a new patch, I also added a fix for the command line options issue. Should be alright now. All examples work fine on win32.

Ok, last request:

Please use the ExecuteProcess variant with an array of string as second
parameter.

Reason: as soon as a command-line argument with spaces in it is passed to
the script, your code will mangle the arguments.

Michael.



More information about the fpc-pascal mailing list