关于数组赋值问题
procedure TForm1.Button1Click(Sender: TObject);var
m,x,y,i:integer;
multiarray: array of string;
begin
setlength(multiarray,m);
for x:= 1 to 10 do
begin
for y:=1 to 10 do
begin
for i:= 0 to m-1 do
begin
if ((x-y)=2) then
begin
r:= x+y;
multiarray[i]:= inttostr(r);
end;
end;
end;
end;
for i:=0 to m-1 do
begin
showmessage(multiarray[i]);
end;
end;
小弟初学delphi.我想得到multiarray数组结果应该为(4,6,8,10,12,14,16,18),但是运行的结果是若干个18. 不知道是哪个地方差点什么。谢谢指教