Stretchwickster
Programmer
Hi,
I have the following code in an OnShow event of Form1. Instead of i initialising to 1 and incrementing, i starts at 1000 and decrements. I've never before seen this weird behaviour from a for loop. Can anyone help?
procedure TForm1.FormShow(Sender: TObject);
Const
ARRAY_LENGTH = 1000;
Var
i: Integer;
kd: Array[1..ARRAY_LENGTH] Of Integer;
begin
for i := 1 to ARRAY_LENGTH do
kd := kd[i-1];
end;
I have the following code in an OnShow event of Form1. Instead of i initialising to 1 and incrementing, i starts at 1000 and decrements. I've never before seen this weird behaviour from a for loop. Can anyone help?
procedure TForm1.FormShow(Sender: TObject);
Const
ARRAY_LENGTH = 1000;
Var
i: Integer;
kd: Array[1..ARRAY_LENGTH] Of Integer;
begin
for i := 1 to ARRAY_LENGTH do
kd := kd[i-1];
end;