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

TShortIntHelper.Bits

Read or write a bit.

Declaration

Source position: syshelph.inc line 944

public property TShortIntHelper.Bits[aIndex: TShortIntBitIndex] : Boolean
  read GetBit
  write PutBit;

Description

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

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

See also

TShortIntHelper.SetBit

  

Set bit to 1.

TShortIntHelper.ClearBit

  

Set bit to 0.

TShortIntHelper.ToggleBit

  

Invert bit.

TShortIntHelper.TestBit

  

Check bit.

TShortIntHelper.HighestSetBitPos

  

Return the position of the leftmost bit set.

TShortIntHelper.LowestSetBitPos

  

Return the position of the rightmost bit set.

TShortIntHelper.SetBitsCount

  

Count number of bits set.

TShortIntHelper.Nibbles

  

Read or write a nibble.


Documentation generated on: Jul 24 2023