Answer the question
In order to leave comments, you need to log in
How to fix error E2066?
There is a procedure for filling arrays:
Procedure FillArrays (var ArrI, ArrFB: TArr; const Row: Integer; const ArrType: TSet);
Var
i: Integer;
Begin
if ArrType = Sorted then
for i := 1 to Row do
ArrI[i] := i
else if ArrType = Reversed then
for i := 1 to Row do
ArrI[i] := Row - i + 1
else
for i := 1 to Row do
ArrI[i] := Random(Row);
ArrFB := ArrI;
End;
Type
TArr = array [1..3000] of Integer;
TARows = array [1..6] of Integer;
TSet = (Sorted, Reversed, Random);
TResArr = array [1..6, 1..12] of Integer;
Const
ARows: TARows = (100, 250, 500, 1000, 2000, 3000);
Output: array [1..3] of String = (' Sorted ', ' Reversed ', ' Random ');
Var
InsertSortArr, FBubbleSortArr: TArr;
ResArr: TResArr;
i, j, IndRes: Integer;
SortKind: TSet;
Answer the question
In order to leave comments, you need to log in
TSet = (Sorted, Reversed, Random);
This declaration made Random a constant with higher visibility precedence than System.Random.
Solutions:
In new Delphi you can write (at the beginning of the code)
and replace
if ArrType = TSet.Sorted then
// …
else if ArrType = TSet.Reversed then
ArrI[i] := System.Random(Row);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question