Sign in Join
FPDoc Onlineexperiment

TWordHelper.Bits property

Member of TWordHelperpublicIn unit sysutils

Read or write a bit.

Declaration

pascal
property Bits[aIndex: TWordBitIndex]: Boolean read GetBit write PutBit;

Description

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

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

See also

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