TestBit
Result = TestBit(Value, BitNo)
 
Parameters:

    Value = An integer value
    BitNo = The bit you want to test (0 = least significant bit)
Returns:

    Result
 

      TestBit checks if a specified bit of is set or cleared. If the bit is set TestBit returns 1, else it returns 0.




Mini Tutorial:


      Showing the effect of TestBit


  
; Test the bits 0 to 7 of the value 170
  For i = 0 To 7
     Print TestBit(170,i)
  Next i
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  



This example would output.

  
  0
  1
  0
  1
  0
  1
  0
  1
  


 
Related Info: ClearBit | SetBit | SwapBit :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com