Logical And 
Author Message
 Logical And

How can I tell if a particular bit in a byte is set in REALbasic?  I
tried using the AND operator, but with no luck.  The code I use is
something like this:

    if 255 and 1 then

I have also tried:
    if 255 and 1=true then

and I have tried
    if 255 and 1=1 then

Nothing seems to work.

Any help would be appreciated.

Thanks,
    Floyd



Tue, 03 Sep 2002 03:00:00 GMT  
 Logical And

Quote:

> Nothing seems to work.

try result=bitwiseand(255,1)

:-) see the online-documentation for more infos...

stephan



Tue, 03 Sep 2002 03:00:00 GMT  
 Logical And

:> How can I tell if a particular bit in a byte is set in REALbasic?  I
:> tried using the AND operator, but with no luck.  The code I use is
:> something like this:
:>
:>     if 255 and 1 then
:>
:> I have also tried:
:>     if 255 and 1=true then
:>
:> and I have tried
:>     if 255 and 1=1 then
:>
:> Nothing seems to work.
:>
:> Any help would be appreciated.
:>
:> Thanks,
:>     Floyd
:>
:>

Look into the help.  RB has BitWiseAnd, BitwiseOr, and BitwiseXOr
functions.

= Steve =

--
Steve W. Jackson,  Montgomery, Alabama
http://www.mindspring.com/~sjacksn/stevehome.html



Tue, 03 Sep 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. logical*4 and logical*8?

2. Logical combinations

3. SST Logical Process question

4. Counting of Logical Records in a Database.

5. How to combine STRING with LOGICAL as an indexkey

6. My logical error -- Misunderstanding Access:FileName

7. logical blocking display

8. INTEGER bit-wise logical operations (?)

9. logical record number

10. Logical Record Number

11. Logical record in a NTX file

12. Q: Names of logical operators

 

 
Powered by phpBB® Forum Software