Table of Content
HAL Forum
function integer TestBit (
integer BitFieldVal,integer Pos)
Description:
Tests if a bit in certain position for the specified number is set or not (starting from the most insignificant bit). Returns 1 if the bit is set and 0 if it's not.
Parameters:
BitFieldVal Numerical value of the BitField
Pos Bit position to check
global
procedure OnApplicationStartup() 
begin
  // 4 => 0100
  stopalert(testbit(4,0)); // 0
  stopalert(testbit(4,1)); // 0 
  stopalert(testbit(4,2)); // 1
  return;
end;
Related topics:
««