首先定义了一个整型变量p_cot,在程序运行中为什么被跳过?不明白!
if bitbtn1.Caption='下一页' then
  begin
    p_i:=0;
    while not query1.Eof do
    begin
      if p_i<23 then 
      begin
        for p_i:=0 to self.ComponentCount-1 do
        begin
          if self.Components[p_i] is tcheckbox then
          begin
            tcheckbox(self.Components[p_i]).Caption:=query1.FieldByName('名称').asstring;
            p_rc:=query1.RecNo+1;            p_cot:=p_cot+1;  //此处程序为什么会跳过?            query1.Next;
            if query1.RecordCount<p_rc then
            begin
              bitbtn1.Caption:='上一页';
              bitbtn1.Glyph.LoadFromFile('C:\company\images\arrow_l.bmp');
              break;
            end;
          end;
        end;
      end
      else
        break;
    end;