How to Perform Bit Masks in an Open Office Calculation

Written by jonah quant
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Perform Bit Masks in an Open Office Calculation
Bitwise operations can be easily added to OpenOffice. (binary numbers image by Photosani from Fotolia.com)

OpenOffice is a free, open-source productivity suite. Calc, a spreadsheet manager, is a part of OpenOffice. Calc allows spreadsheet cells to contain values that are a function of the current values of other cells; the user specifies a formula using the built-in operators. However, no built-in operators perform bitwise operations. You can add bitwise functions as BASIC macros, so that they can be used to implement all forms of bit masks.

Skill level:
Easy

Other People Are Reading

Instructions

  1. 1

    Invoke Calc by double-clicking on its icon.

  2. 2

    Select "Tools," "Macros," "Organize macros," then "OpenOffice.org BASIC." The macro creation window will come up.

  3. 3

    Enter "Bitwise" in the "Macro name" field, then click on "New." The program editor window will come up. Erase everything under the "REM" line.

  4. 4

    Enter the source code for the new macros:

    Function BitAND( val1 , val2 )

    BitAND = val1 AND val2

    End Function

    Function BitOR( val1 , val2 )

    BitOR = val1 OR val2

    End Function

    Function BitXOR( val1 , val2 )

    BitXOR = val1 XOR val2

    End Function

  5. 5

    Click on the "Compile" icon. Click on the "Save" icon. The three functions "BitAND," "BitOR" and "BitXOR" are now available to compute cell values.

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.