Sign in Join
FPDoc Onlineexperiment

TShortIntHelper.Bits property

Member of TShortIntHelperpublicIn unit sysutils

Read or write a bit.

Declaration

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

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