[fpc-pascal] run pascal programs as scripts

Darius Blaszyk dhkblaszyk at zeelandnet.nl
Thu Mar 31 10:15:38 CEST 2011


On Mar 31, 2011, at 9:20 AM, michael.vancanneyt at wisa.be wrote:

> 
> 
> On Thu, 31 Mar 2011, Darius Blaszyk wrote:
> 
>> I created a patch to make instantFPC run on win32. To make the app run I
>> implemented TProcess as windows does not understands fpexecv.  Even better
>> would be to use TProcess for all platforms, thus removing the need of
>> defines and we could drop the unix and windows units.
> 
> I doubt it since execv actually replaces the current running process with the
> indicated binary (i.e. the binary you just compiled).
> 
>> The only script that did not work for me was exitcode.pas. I will have to look more in detail how to support this.
> 
> That will require an alternative to fpexecv.

I dont believe it was a fpexecv problem. The issue was that the command line option was not passed at all. Could well be that I'm misinterpreting the intention of how to use it.

I did a: instantpfc exitcode.pas 1

Assuming that the compiler options come from the shebang line and the "1" provided on the command line is passed as parameter to exitcode.exe. But as said the "1" never reached the executable. I will test mac later today to see how it should work.

Regards, Darius




More information about the fpc-pascal mailing list