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

TCardinalHelper.Bits

Read or write a bit.

Declaration

Source position: syshelph.inc line 1126

public property TCardinalHelper.Bits[aIndex: TCardinalBitIndex] : Boolean
  read GetBit
  write PutBit;

Description

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

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

See also

TCardinalHelper.SetBit

  

Set bit to 1.

TCardinalHelper.ClearBit

  

Set bit to 0.

TCardinalHelper.ToggleBit

  

Invert bit.

TCardinalHelper.TestBit

  

Check bit.

TCardinalHelper.HighestSetBitPos

  

Return the position of the leftmost bit set.

TCardinalHelper.LowestSetBitPos

  

Return the position of the rightmost bit set.

TCardinalHelper.SetBitsCount

  

Count number of bits set.

TCardinalHelper.Nibbles

  

Read or write a nibble.

TCardinalHelper.Bytes

  

Read or write a byte.

TCardinalHelper.Words

  

Read or write a word.


Documentation generated on: Dec 21 2024