[fpc-pascal] InstantFPC and argv

Tomas Hajny XHajT03 at hajny.biz
Sat May 5 15:10:13 CEST 2012

On Sat, May 5, 2012 14:08, Jonas Maebe wrote:
> On 05 May 2012, at 14:02, Tomas Hajny wrote:
>> My proposal is platform independent (i.e. it will work also under Win32,
>> OS/2, etc., without any changes). Your proposal probably requires
>> starting
>> the compiled binary using platform specific API functions to run it with
>> a
>> modified environment rather than using ExecuteProcess which results in
>> passing the standard parent's environment (changing the current's
>> process
>> environment may not be supported on all platforms).
> An alternative would be for instantfpc to create a temporary unit
> containing this constant, and inject it in the main program via the -Fa
> parameter. I don't know whether moving an instantfpc-based script also
> invalidates the cached compiled copy though (but I guess it does, because
> otherwise you wouldn't be able have two scripts with the same name in
> different locations).

Yes, this is a nice one. I originally thought about a unit too, but it
wasn't much better without the -Fa idea (which I didn't remember).


More information about the fpc-pascal mailing list