---- 02:01:35
begin
for i:= 1 to dgView.ColCount -1 do
dgView.Columns[i].Visible := false;
MsgBox('a');
begin
if sameText(dgView.Columns[i].FieldName, 'ORG_NAME') then dgView.Columns[i].Visible := True;
if sameText(dgView.Columns[i].FieldName, 'USER_NAME') then dgView.Columns[i].Visible := True;
if sameText(dgView.Columns[i].FieldName, 'p2') then dgView.Columns[i].Visible := True;
if sameText(dgView.Columns[i].FieldName, 'month_sort') then dgView.Columns[i].Visible := True;
if sameText(dgView.Columns[i].FieldName, 'allw') then dgView.Columns[i].Visible := True;
if sameText(dgView.Columns[i].FieldName, 'payed_sort') then dgView.Columns[i].Visible := True;
end;
end;
---- 02:01:55
这个地方为什么会越界??
这地方为什么会越界,因为i的值在for循环结束以后,超过了边界.