Length: Integer;
The Length property determines bit array size.
Sub UserProc;
Var
BitArr: IBitArray;
i: Integer;
Begin
BitArr := New BitArray.Create;
BitArr.Length := 15;
For i := 0 To BitArr.Length - 1 Do
If Math.Round(Math.Rand, 0) = 1 Then
BitArr.Item(i) := True;
Else
BitArr.Item(i) := False;
End If;
End For;
End Sub UserProc;
After executing the example a bit array that contains 15 elements is generated.
See also: