Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2017-04

GetEnvironmentVariable

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner

Hi,

Under Windows GetEnvironmentVariable(AnsiString) uses the winapi function GetEnvironmentStringsA.

Why not simply:

Result:=String(GetEnvironmentVariable(UnicodeString(EnvVar)));

?

This would save some code and would work with another DefaultSystemCodepage as well.

Mattias

Reply by email