<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Am 18.05.2017 um 00:30 schrieb Mattias
Gaertner via Lazarus:<br>
</div>
<blockquote type="cite"
cite="mid:20170518003006.70d8edac@limapholos.matflo.wg">
<pre wrap="">On Wed, 17 May 2017 22:27:20 +0200
Joe via Lazarus <a class="moz-txt-link-rfc2396E" href="mailto:lazarus@lists.lazarus-ide.org"><lazarus@lists.lazarus-ide.org></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">[...]
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):
</pre>
</blockquote>
<pre wrap="">
Yes, although this is more exact:
Help / About Lazarus / Right mouse click on logo / Copy version info to
clipboard.
</pre>
<blockquote type="cite">
<pre wrap="">"GetEnvironmentVariable('computername')" doesn't work.
When compiling, it returns "Error: Wrong number of Parameters specified
for call to GetEnvironmentVariable".
</pre>
</blockquote>
<pre wrap="">
The SysUtils GetEnvironmentVariable expects one string. So, maybe you
have somewhere another GetEnvironmentVariable?
Use Find Declaration to find out.
Mattias
</pre>
</blockquote>
<br>
Mattias,<br>
<br>
Find Declaration shows two entries in file osutilsh.inc, lines 25
and 26:<br>
Function GetEnvironmentVariable(Const EnvVar : AnsiString) :
AnsiString;<br>
Function GetEnvironmentVariable(Const EnvVar : UnicodeString) :
UnicodeString; <br>
<br>
But Code Completion offers three functions named
GetEnvironmentVariable:<br>
The Ansistring function and the Unicode String function above plus<br>
"GetEnvironmentVariable(lpName: LPCSTR; lpBuffer: LPSTR; nSize:
DWORD): DWORD". <br>
<br>
Seems, Lazarus tries to use only the latter<font size="-1">. <br>
</font><br>
No, I don't have another GetEnvironmentVariable.<br>
<br>
You can reproduce this easily:<br>
Put a TButton Button1 on a form.<br>
In the OnClick Event for this button write "Button1.Caption :=
GetEnvironmentVariable ('computername');"<br>
<br>
Version Info (Thank you for this hint):<br>
Lazarus 1.8.0RC1 r54919 FPC 3.0.2 x86_64-win64-win32/win64<br>
<br>
Joe<br>
</body>
</html>