` Bit manipulation (BAND) (Tom Leech ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Bit manipulation (BAND)
2000-12-20 -- Tom Leech
 
Some time ago I wrote a little function that given the mask and the particular bit position you wanted to check, the function returns true if a 1 is in that bit or false if its 0. CompareMask PROCEDURE (msk,indx) ReturnValue Byte MIndex long CODE MIndex = Bshift(1,Indx-1) ! Shift a 1 into the proper position (base 0) if Band(msk,MIndex) = Mindex ! If in mask and equals Mindex then TRUE ReturnValue = TRUE else ReturnValue = FALSE end


Today is November 21, 2024, 7:47 am
This article has been viewed 35213 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: