swirl
Guide to OmniMark 8   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 string 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 ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.