[fpc-pascal] InstantFPC and argv

Jonas Maebe jonas.maebe at elis.ugent.be
Sat May 5 14:08:26 CEST 2012


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).


Jonas


More information about the fpc-pascal mailing list