[Lazarus] Finding out the Hostname of the Computer.
Malcolm Poole
malcolm at lingua-z.co.uk
Fri Nov 28 22:31:05 CET 2008
Aleš Katona wrote:
> If you want the value of $HOSTNAME, use unit SysUtils and GetEnvironmentVariable('HOSTNAME');
>
Hmm. This was the first thing that I tried. For some reason I get an
empty string on my system (Ubuntu Gutsy). That's why I dug around and
found the GetHostName function.
Any idea why GetEnvironmentVariable('HOSTNAME') doesn't work for me?
'echo $HOSTNAME' on the commandline works as expected.
Malcolm
More information about the Lazarus
mailing list