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

TIntegerHelper.Bits

Read or write a bit.

Declaration

Source position: syshelph.inc line 1195

public property TIntegerHelper.Bits[aIndex: TIntegerBitIndex] : Boolean
  read GetBit
  write PutBit;

Description

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

MyInteger.Clear;// %00000000000000000000000000000000 MyInteger equals 0
MyInteger.Bits[0] := true;  // %00000000000000000000000000000001 MyInteger equals 1
MyInteger.Bits[2] := true;  // %00000000000000000000000000000101 MyInteger equals 5
WriteLn(MyInteger.Bits[2]); // TRUE

See also

TIntegerHelper.SetBit

  

Set bit to 1.

TIntegerHelper.ClearBit

  

Set bit to 0.

TIntegerHelper.ToggleBit

  

Invert bit.

TIntegerHelper.TestBit

  

Check bit.

TIntegerHelper.HighestSetBitPos

  

Return the position of the leftmost bit set.

TIntegerHelper.LowestSetBitPos

  

Return the position of the rightmost bit set.

TIntegerHelper.SetBitsCount

  

Count number of bits set.

TIntegerHelper.Nibbles

  

Read or write a nibble.

TIntegerHelper.Bytes

  

Read or write a byte.

TIntegerHelper.Words

  

Read or write a word.


Documentation generated on: Oct 27 2024