project BLF > class TDaemonUtility > method GetHostName
Description
get the host name of the server where this code is running on
Parameters
ocHostName | output | character | |
Internal usage
BLF
program code (program1/tdaemonutility.p)
ocHostName = os-getenv ("HOSTNAME").
if ocHostName = ""
or ocHostName = ?
or ocHostName = "?"
then if opsys = "unix"
then do:
input stream sProcessRead through ("hostname") no-echo.
import stream sProcessRead ocHostName.
input stream sProcessRead close.
end.
else ocHostName = os-getenv ("COMPUTERNAME").
if ocHostName = ?
or ocHostName = "?"
then ocHostName = "".
else ocHostName = entry (1,ocHostName,".").