JCL Help:ClearBit@Byte@TBitRange

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Clears a bit in an integer-type value.


Pascal

 function ClearBit(const Value: Byte; const Bit: TBitRange): Byte; overload;
function ClearBit(const Value: Shortint; const Bit: TBitRange): Shortint; overload;
function ClearBit(const Value: Smallint; const Bit: TBitRange): Smallint; overload;
function ClearBit(const Value: Word; const Bit: TBitRange): Word; overload;
function ClearBit(const Value: Integer; const Bit: TBitRange): Integer; overload;
function ClearBit(const Value: Cardinal; const Bit: TBitRange): Cardinal; overload;
function ClearBit(const Value: Int64; const Bit: TBitRange): Int64; overload;


Parameters

Parameters Description
const Value: Byte The integer-typed variable for which to clear a bit.
const Bit: TBitRange The 0 based bit position of the bit to clear. This is a modulo N bit position where N is the number of bits in the Value parameter. For example, if Value is a Byte, then Bit position is interpreted as Bit mod 8.


Return Value

Copy of Value with the bit at position Bit cleared.


Description

ClearBit clears the specified bit position of the passed integer typed variable. In other words, it sets the bit at position Bit for Value to 0. This function exists in 7 different forms, one for each integer type.


See Also

TestBit TestBits 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