定义过程,那里错了
public
procedure selectbox(dbgrid:Tdbgrideh;i:integer);
{ Public declarations }
end;/////////////////定义过程
procedure tattribform.selectbox(dbgrid:Tdbgrideh ;i:integer);
begin
with DBGridEh1 do
begin
case columns[i].Visible of
true:combobox2.ItemIndex:=0;
false:combobox2.ItemIndex:=1;
end;
edit1.Text:=inttostr(Columns[i].Width);
edit2.Text:=Columns[i].Title.Caption;
colorbox1.Selected:=Columns[i].Title.Color;
case columns[i].Alignment of
taleftjustify:combobox3.ItemIndex:=0;
tacenter:combobox3.ItemIndex:=1;
taRightJustify:combobox3.ItemIndex:=2;
end;
colorbox2.Selected:=Columns[i].Color;
case columns[i].Footer.ValueType of
fvtnon:combobox4.ItemIndex:=0;
fvtcount:combobox4.ItemIndex:=1;
fvtsum:combobox4.ItemIndex:=2;
end;
end
end; ////////////////////////////////////////////过程内容
procedure Tattribform.ComboBox1Select(Sender: TObject);
var
a:string;
i:integer;
begin
a:=trim(combobox1.Text);
i:=pos('|',a);
a:=leftstr(a,i-1);
i:=strtoint(a);
if attribform.Tag=3 then
selectbox(distform.DBGridEh1,i)
else if attribform.Tag=2 then
selectbox(batsaleform.DBGridEh1,i)
else
selectbox(acceptform.DBGridEh1,i);
end; //////////////////////////////////////////////引用过程
请教各位,那里写的不正确,报List index out of bounds (6)这个错误
[解决办法]
这个 应该是 运行时错误吧,应该是你的 [?] 中有地方越界了
[解决办法]
变量i值有问题