project BLF > class TDaemonUtility > method GetHostName

Description

get the host name of the server where this code is running on


Parameters


ocHostNameoutputcharacter


Internal usage


BLF
method BBaseDaemonProcessor.Initialize
method TDaemonUtility.KillDaemonProcessesInternal
method TDaemonUtility.ProcessIsValidInternal


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,".").