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

net-long

 
 

Library: Network utilities (OMNETUTL legacy)
Include: omnetutl.xin

Declaration

net-long


Purpose

Use net-long to match a single long network number in a stream of bytes/octets.

Example

The following program takes a string consisting of three network order numbers and matches them individually. The output (on Windows) is two numbers that are the same (the first two numbers), followed one number that is different (the third number). They are output in host order.


  include "omnetutl.xin"
  
  process
     local stream network-bytes initial { "%1#%2#%3#%4#%1#%2#%3#%4#%4#%3#%3#%4#" }
     local integer host-long
  
     repeat scan network-bytes
        match net-long => x
           set host-long to from-net-long (x)
           output "d" % host-long || " "
     again
     output "%n"

      Other Library Functions
 
 

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

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:38:10 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.