[fpc-pascal] SysUtils.GetEnvironmentVariable

Sven Barth pascaldragon at googlemail.com
Thu Mar 29 13:13:18 CEST 2012


Am 29.03.2012 13:06, schrieb Marcos Douglas:
> The application is installed and the system variable is created. The
> application and others process should be use this variable just
> calling SysUtils.GetEnvironmentVariable.

Then let a FPC program print all passed environment variables as a test:

=== source begin ===

program envtest;

var
   i: LongInt;
begin
   for i := 0 to GetEnvironmentVariableCount do
     Writeln(GetEnvironmentString(i)); // Note: this will include 
"name=value" unlike GetEnvironmentVariable
end.

=== source end ===

Also - as I already wrote - you can use the Process Explorer ( 
http://technet.microsoft.com/de-de/sysinternals/bb896653 ) to check 
whether the application does indeed contain the environment variable.

Regards,
Sven



More information about the fpc-pascal mailing list