Clone: IBitArray;
The Clone method creates a copy of the array.
Sub UserProc;
Var
BitArr, BitArr1: IBitArray;
i: Integer;
Begin
BitArr := New BitArray.Create;
BitArr1 := New BitArray.Create;
For i := 0 To Math.RandBetweenI(50, 100) Do
If Math.Round(Math.Rand, 0) = 1 Then
BitArr.Item(i) := True;
Else
BitArr.Item(i) := False;
End If;
End For;
BitArr1 := BitArr.Clone;
End Sub UserProc;
After executing the example the BitArr array contains a copy of the BitArr1 array.
See also: