数组问题(50分)

  • 主题发起人 主题发起人 午午
  • 开始时间 开始时间

午午

Unregistered / Unconfirmed
GUEST, unregistred user!
编译出现Array Type Required 错误
代码如下:
procedure TFrontStageForm.QuickRep1NeedData(Sender: TObject;
var MoreData: Boolean);
type
STGD=Array of STGDRec;
var
a ,b,index:integer;
a0,a1,a2,a3,a4,a5:string;
SG:STGD;
begin
index:=0;
a:=StringGrid1.RowCount;
SetLength(SG,a);

for b:=1 to ado
begin
SG[b-1].Id:=StringGrid1.Cells[0,b];
SG[b-1].MenuId:=StringGrid1.Cells[1,b];
SG[b-1].MenuName:=StringGrid1.Cells[2,b];
SG[b-1].Num:=StrToFloat(StringGrid1.Cells[3,b]);
SG[b-1].Danwei:=StringGrid1.Cells[4,b];
SG[b-1].UnitPrice:=StrToCurr(StringGrid1.Cells[5,b]);
end;
if index<=length(SG) then
begin
a0:=SG[index,0];//就在这以下都出错
a1:=SG[index,1];
a2:=SG[index,2];
a3:=SG[index,3];
a4:=SG[index,4];
a5:=SG[index,5];
Inc(index);
MoreData:=True;
end
else
MoreData:=False;
end;
 
来个人,帮帮忙啦。。。
 
后退
顶部