Unit 'sysutils' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

TByteHelper.Bits

Read or write a bit.

Declaration

Source position: syshelph.inc line 904

public property TByteHelper.Bits[aIndex: TByteBitIndex] : Boolean
  read GetBit
  write PutBit;

Description

Bits property reads or writes boolean value to a bit number determined by argument aIndex.

MyByte.Clear;// %00000000 MyByte equals 0
MyByte.Bits[0] := true;  // %00000001 MyByte equals 1
MyByte.Bits[2] := true;  // %00000101 MyByte equals 5
WriteLn(MyByte.Bits[2]); // TRUE

See also

TByteHelper.SetBit

  

Set bit to 1.

TByteHelper.ClearBit

  

Set bit to 0.

TByteHelper.ToggleBit

  

Invert bit.

TByteHelper.TestBit

  

Check bit.

TByteHelper.HighestSetBitPos

  

Return the position of the leftmost bit set.

TByteHelper.LowestSetBitPos

  

Return the position of the rightmost bit set.

TByteHelper.SetBitsCount

  

Count number of bits set.

TByteHelper.Nibbles

  

Read or write a nibble.


Documentation generated on: Nov 26 2024