Am 18.05.2017 um 00:30 schrieb Mattias Gaertner via Lazarus:
On Wed, 17 May 2017 22:27:20 +0200
Joe via Lazarus <lazarus@lists.lazarus-ide.org> wrote:

[...]
Is this the correct way to report my finding? As a non professional I am
not sure.

Lazarus 1.8 RC1 under Win 10 (64):
Yes, although this is more exact:
Help / About Lazarus / Right mouse click on logo / Copy version info to
clipboard.


"GetEnvironmentVariable('computername')" doesn't work.
When compiling, it returns "Error: Wrong number of Parameters specified
for call to GetEnvironmentVariable".
The SysUtils GetEnvironmentVariable expects one string. So, maybe you
have somewhere another GetEnvironmentVariable?
Use Find Declaration to find out.

Mattias

Mattias,

Find Declaration shows two entries in file osutilsh.inc, lines 25 and 26:
Function GetEnvironmentVariable(Const EnvVar : AnsiString) : AnsiString;
Function GetEnvironmentVariable(Const EnvVar : UnicodeString) : UnicodeString;

But Code Completion offers three functions named GetEnvironmentVariable:
The Ansistring function and the Unicode String function above plus
"GetEnvironmentVariable(lpName: LPCSTR; lpBuffer: LPSTR; nSize: DWORD): DWORD".

Seems, Lazarus tries to use only the latter.

No, I don't have another GetEnvironmentVariable.

You can reproduce this easily:
Put a TButton Button1 on a form.
In the OnClick Event for this button write "Button1.Caption := GetEnvironmentVariable ('computername');"

Version Info (Thank you for this hint):
Lazarus 1.8.0RC1 r54919 FPC 3.0.2 x86_64-win64-win32/win64

Joe
-- 
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to