[fpc-pascal] SysUtils.GetEnvironmentVariable

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Thu Mar 29 10:42:41 CEST 2012


Marcos Douglas wrote:

> I know that I have to define the environment variable before or after
> starting the application or IDE.
> As I said, works in WinXP... but I had a little problem with a client
> using Win7 so, I talked about this on lazarus-br list and asked to
> somebody do the test on Win7 and they said the test did not work so, I
> wrote here.

I think the absolutely crucial thing here is to ask what the 
relationship between the session in which the shell/environment variable 
was defined, and the FPC program.

If the variable is set and the program is run from the same prompt, 
provided that it's not messed up by extra spaces or by e.g. an 
interposed command.com, then it should work.

In any other case it might work, and it's entirely reasonable to assume 
that the extent to which variables are passed between running processes 
will vary wildly with OS version.

I suggest the *first* thing to do is to confirm that the variable has 
stuck by using the  set  command. After that try running the Pascal program.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list