Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Print:
PDF:

Feature

Bitwise Operations for Noobs

Working with bits

Issue: 5.2 (January/February 2007)
Author: Aaron Ballman
Article Description: No description available.
Article Length (in bytes): 18,817
Starting Page Number: 26
RBD Number: 5210
Resource File(s):

Download Icon 5210.zip Updated: Monday, January 15, 2007 at 1:16 PM

Related Web Link(s):

http://en.wikipedia.org/wiki/Truth_table

Known Limitations: None

Excerpt of article text...

If you've done any programming with REALbasic before, then chances are pretty good that you've used logical (Boolean) operators before, such as And, Or, & Not. These operators provide you with a logical way to describe a Boolean process. For instance, you may have code which says:

If UserIsAuthorized and OperationIsPermitted then DoOperation( user, operation )

If not ActionFailed then Success( "yay!" )

If Cold or Mild then MsgBox( "It's not hot out" )

These operations read as easy as English and provide your control statements with logic (hence the reason they're called logical operators). However, there's a similar class of operations called Bitwise or Arithmetic operators. These operators are very similar to logical ones in that they provide a means for describing ways of combining two operands. However, instead of involving the Boolean logic of true and false, they involve the mathematical logic of ones and zeros.

You may be thinking to yourself, "But I hate math!" Don't worry! The beauty of the two concepts is that they're generally very closely related. You can map the logical term "true" to the mathematical value "1" and "false" to "0." The main difference between logical and bitwise operations is that with bitwise operators, you're not working with just one bit of information, but a string of bits.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com