|
|||||
function | NETGetHostIP |
Other Library Functions |
Library: Network Utilities
Include: omnetutl.xin |
Returns: String
The IP of a host computer given its name. |
define external stream function NETGetHostIP By-Name value stream Host-Name optional
This function allows you to retrieve the Internet Protocol (IP) address of a host computer given its name. The IP address is returned in dotted decimal format (for example, "127.0.0.1"). If no host name is specified, NETGetHostIP
returns the IP address of the local host. If NETGetHostIP
fails to retrieve the IP address, it returns NETInvalidIP
which is defined as "255.255.255.255".
Argument:
Examples:
; get host IP given its name or name alias ; set host to "www.omnimark.com" output "ip of %g(host) is: <" || NETGetHostIP By-Name host || ">%n"
; get the IP of the local host ; output "Local host ip is: <" || NETGetHostIP || ">%n"
Other Library Functions from-net-long net-long NETGetHostIP NETGetHostName NETIsVersionCompatible NETLibraryVersion to-net-long |
---- |