num[1]:=temp[1];             //temp[1]的值是直接赋的num[1]做相同处理
for i:=2 to count do         //count:数据表中记录的条数
begin
     for j:=i to lastnum do  //lastnum:temp数组中的最大数值同时也是数据表中的最大数
     begin
          adoquery2.Close;
          adoquery2.SQL.Clear;
          adoquery2.SQL.Add('select GradeNum from PInfoTable where GradeNum='''+inttostr(temp[j])+'''');
          adoquery2.Open;
          if adoquery2.found then
          begin
               num[i]:=temp[j];
               break;
          end
          else
          begin
               continue;
          end;
     end;
end;
用这句话测试时frmmain.Label1.Caption:=inttostr(num[2]); 除了num[1]正确外,其余值全为0,明显不对,除了num[1]有可能是0外,当再出现0时肯定应该是在i=count+1的位置及其之后,所以判定temp的值没有转存过来,但又找不到问题所在,苦等救援