JCL Help:TestBits@Byte@Byte

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Test multiple bits.


Pascal

 function TestBits(const Value: Byte; const Mask: Byte): Boolean; overload;
function TestBits(const Value: Shortint; const Mask: Shortint): Boolean; overload;
function TestBits(const Value: Smallint; const Mask: Smallint): Boolean; overload;
function TestBits(const Value: Word; const Mask: Word): Boolean; overload;
function TestBits(const Value: Cardinal; const Mask: Cardinal): Boolean; overload;
function TestBits(const Value: Integer; const Mask: Integer): Boolean; overload;
function TestBits(const Value: Int64; const Mask: Int64): Boolean; overload;


Parameters

Parameters Description
const Value: Byte The Value whose bits to test.
const Mask: Byte The Mask containing the bits to test.


Return Value

If all the bits in the Mask are also set in Value the result is True, otherwise it's False.


Description

TestBits performs a bitwise and operation on Value and Mask. This in effect tests whether all bits that are set in Mask are also set in Value.


See Also

TestBit ClearBit ToggleBit SetBit


About

Unit

JclLogic


Donator

Marcel van Brakel


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page