swirl Guide to OmniMark 6   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
      Other Library Functions  
function   NETGetHostIP   Available in:
Professional
Enterprise

Library: omnetutl - miscellaneous network utilities
Include: omnetutl.xin
Return type: String
Returns:       

The IP of a host computer given its name.


Declaration

  define external stream function NETGetHostIP
     By-Name value stream Host-Name optional
  where
Host-Name
is the name of the host computer you want to retrieve the IP address of.


Purpose

Use NETGetHostIP to retrieve the Internet Protocol (IP) address of a host computer, given its name.

Requirements

You must include the following line at the beginning of your OmniMark program:

  include "omnetutl.xin"

Usage Notes

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

Examples

This sample gets the host IP given its name or name alias.

  include "omnetutl.xin"

  process
    local stream host
    set host to "www.omnimark.com"
    output "ip of %g(host) is: <" || NETGetHostIP By-Name host || ">%n"

This sample gets the IP of the local host.


  include "omnetutl.xin"

  process

    output "Local host ip is: <" || NETGetHostIP || ">%n"

        Other Library Functions
   from-net-long
   NETGetHostIP
   NETGetHostName
   NETIsVersionCompatible
   NETLibraryVersion
   net-long
   to-net-long
 
----  

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ OMX ] [ ERRORS ]

OmniMark 6.5 Documentation Generated: December 23, 2002 at 6:25:30 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © OmniMark Technologies Corporation, 1988-2002.