swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
      Other Library Functions  
function  

NETGetHostIP

 
 

Library: Network utilities (OMNETUTL) legacy library
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

Argument definitions

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 ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:33 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.