Sign in Join
FPDoc Onlineexperiment

TIntegerHelper.Bits property

Member of TIntegerHelperpublicIn unit sysutils

Read or write a bit.

Declaration

pascal
property 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

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.