Hostname: Difference between revisions

Content added Content deleted
(→‎{{header|Pascal}}: add example)
m (→‎{{header|Pascal}}: add link to Delphi for windows)
Line 304: Line 304:


=={{header|Pascal}}==
=={{header|Pascal}}==
For Windows systems see the [[Hostname#Delphi | Delphi]] example.
FreePascal has the unix unit with the function GetHostName:
On Unix systems, FreePascal has the function GetHostName:
<lang pascal>Program HostName;
<lang pascal>Program HostName;


Line 313: Line 314:
writeln('The name of this computer is: ', GetHostName);
writeln('The name of this computer is: ', GetHostName);
end.</lang>
end.</lang>
Output example:
Output example on Mac OS X:
<pre>
<pre>
The name of this computer is: MyComputer.local
The name of this computer is: MyComputer.local