Portability Function: Returns the current host computer name. This function can also be specified as HOSTNM.
Module: USE IFPORT
Syntax
result = HOSTNAM (name)
name
(Output) Character*(*). Name of the current host. Should be at least as long as MAX_HOSTNAM_LENGTH + 1. MAX_HOSTNAM_LENGTH is defined in the IFPORT module.
Results
The result type is INTEGER(4). The result is zero if successful. If name is not long enough to contain all of the host name, the function truncates the host name and returns -1.
Compatibility
CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB
Example
use IFPORT
character(MAX_HOSTNAM_LENGTH + 1) hostnam
integer(4) istat
ISTAT = HOSTNAM (hostname)