我正在尝试制作一个数组数组来获取数据(我之前添加过),将其称为“GameMap[i,j,k].Items[m].Index”或“GameMap[i,j,k ]。数数”
我在 delphi 中的类型部分如下所示:
type
TItemRec = record
Index: Integer;
Volume: Integer;
Count: Integer;
Id: string;
end;
TMApRec = record
ID: LongWord;
Count: integer;
Order1: integer;
Order2: integer;
Order3: integer;
Order4: integer;
Order5: integer;
Order6: integer;
Order7: integer;
Order8: integer;
Order9: integer;
Order10: integer;
Items: array[0..9] of TItemRec;
end;
TMap = class
GameMap : array[0..8,0..14,0..$12] of TMapRec;
例如,如果我现在这样做:
procedure TMap.Update;
var
i,j,k,m: integer;
begin
i:=0;
while i < 8 do
begin
j:=0;
while j < 14 do
begin
k:=0;
while k < $12 do
begin
m:= 0;
while m < 10 do
begin
showmessage('asdf');
GameMap[i,j,k].Items[m].Id:= (inttostr(i)+' '+inttostr(j)+' '+inttostr(k)+' '+inttostr(m));
showmessage((GameMap[i,j,k].Items[m].Id));
inc(m);
end;
inc(k);
end;
inc(j);
end;
inc(i);
end;
它只会显示第一个showmessage('asdf'),但是如果你想突出显示它,它会在这里崩溃你有完整的代码http://pastebin.com/xfL94QXU
再次感谢你们的时间