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

TWordHelper.Bits

Read or write a bit

Declaration

Source position: syshelph.inc line 538

public property TWordHelper.Bits[aIndex: TWordBitIndex] : Boolean
  read GetBit
  write PutBit;

Description

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

MyWord.Clear;// %0000000000000000 MyWord equals 0
MyWord.Bits[0] := true;  // %0000000000000001 MyWord equals 1
MyWord.Bits[2] := true;  // %0000000000000101 MyWord equals 5
WriteLn(MyWord.Bits[2]); // TRUE

See also

TWordHelper.SetBit

  

Set bit to 1

TWordHelper.ClearBit

  

Set bit to 0

TWordHelper.ToggleBit

  

Invert bit

TWordHelper.TestBit

  

Check bit

TWordHelper.HighestSetBitPos

  

Return the position of the leftmost bit set

TWordHelper.LowestSetBitPos

  

Return the position of the rightmost bit set

TWordHelper.SetBitsCount

  

Count number of bits set

TWordHelper.Nibbles

  

Read or write a nibble

TWordHelper.Bytes

  

Read or write a byte


Documentation generated on: Sep 29 2022