swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
    Related Concepts  
operator  

mask

 
 

Return type: Integer
Returns:       A bit sequence.

Syntax

numeric-expresion mask numeric-expression


Purpose

mask is a bit-oriented operator used to help isolate, process and create binary values. The result of masking two bit sequences is a new sequence where each bit in the new sequence is one (1) if both corresponding bits in the masked sequence are one (1), and zero (0) if either of the corresponding bits is zero (0).

Other languages sometimes refer to this operation as a "bit-wise and" because the operation is analogous to the logical "and" operation. To avoid confusion, OmniMark reserves the keyword and and the operator "&" for the logical "and" operation.

The example shows a do block which will be executed if the lowest order bit in "c" has the value 1.

  do when c mask 1 != 0
  ...
  done

      Related Concepts
   Bit-oriented arithmetic
 
 

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

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

Copyright © Stilo International plc, 1988-2008.