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

TSmallIntHelper.Bits

Read or write a bit.

Declaration

Source position: syshelph.inc line 1055

public property TSmallIntHelper.Bits[aIndex: TSmallIntBitIndex] : Boolean
  read GetBit
  write PutBit;

Description

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

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

See also

TSmallIntHelper.SetBit

  

Set bit to 1.

TSmallIntHelper.ClearBit

  

Set bit to 0.

TSmallIntHelper.ToggleBit

  

Invert bit.

TSmallIntHelper.TestBit

  

Check bit.

TSmallIntHelper.HighestSetBitPos

  

Return the position of the leftmost bit set.

TSmallIntHelper.LowestSetBitPos

  

Return the position of the rightmost bit set.

TSmallIntHelper.SetBitsCount

  

Count number of bits set.

TSmallIntHelper.Nibbles

  

Read or write a nibble.

TSmallIntHelper.Bytes

  

Read or write a byte.


Documentation generated on: Oct 27 2024