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

netutil.to-net32

 
 

Library: Network utilities (OMNETUTIL)
Import: omnetutl.xmd
Return type: Integer

Returns: Returns a number encoded as a 32-bit binary value, with the bytes in network order.


Declaration

export string function 
   to-net32 value integer c

Argument definitions

c
is an integer value


Purpose

Use netutil.to-net32 to translate an integer value into a sequence of bytes/octets that is the integer value's long network number encoding.

Example

This program creates a file containing the numbers from 0 to 1,000,000 (counting by 1,000s). It stores the numbers in network-ordered binary format, to create a smaller, platform-independent file.

  import "omnetutil.xmd" prefixed by netutil.
  
  process
     using output as file "net32.dat" with binary-mode
        repeat for integer i from 0 to 1000000 by 1000
           output netutil.to-net32 i
        again
     close s

This file can be read on any platform, with the same results.

      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.