function tformpicture.next(str:string):string;
var i,j:integer;
s:array[1..50] of string;
begin
  with form4 do
    begin
        if adoquery1.Active then adoquery1.Close;
        adoquery1.SQL.Clear;
        adoquery1.SQL.Add('select * from processgx where sprocesscode='+#39+str+#39);
        adoquery1.Open;
        //如果是最后一个过程那么退出
        if adoquery1.RecordCount=0 then
           begin
           result:='true';
           exit;
           end
        //后面有一个过程的情况
        else if adoquery1.RecordCount=1 then
           begin
             //察看后面这个过程有没有选
             if adoquery2.Active then adoquery2.Close;
                adoquery2.SQL.Clear;
                adoquery2.SQL.Add('select * from imageunit where suintcode='+#39+adoquery1.Fields[1].asstring+#39);
                adoquery2.Open;
             //如果没有选的情况
             if adoquery2.RecordCount=0 then
                begin
                //察看该过程是不是必须的
                if adoquery1.Fields[5].AsString='是' then
                   begin
                   result:='false';
                   showmessage(adoquery1.fields[4].AsString+'的下道单元过程'+adoquery1.Fields[2].AsString+'没有选');
                   exit;
                   end
                //下道过程不是必须的情况
                else
                   begin
                    result:='true';
                    exit;
                   end;
                end
              //下道过程已经选了情况
              else
                begin
                result:='true';
                exit;
                end;
           end
          //下道过程有多个的情况
        else if adoquery1.RecordCount>1 then
           begin
            for i:=1 to adoquery1.RecordCount do
               begin
                adoquery1.RecNo:=i;
                if adoquery2.Active then adoquery1.Close;
                   adoquery2.SQL.Clear;
                   adoquery2.SQL.Add('select * from imageunit where unitcode='+#39+adoquery1.Fields[1].asstring+#39);
                   adoquery2.Open;
                   if adoquery2.RecordCount=0 then
                      j:=j+1
                   else  //有其中一个过程选了
                      begin
                       result:='true';
                       exit;
                      end;
               end;
              //如果下道过程一个都没有选的情况
              if (j>1) and (j=adoquery1.RecordCount) then
                  begin
                  for i:=1 to adoquery1.RecordCount do
                    begin
                    adoquery1.RecNo:=i;
                    s[i]:=adoquery1.Fields[3].AsString;
                    end;
                  for i:=1 to adoquery1.RecordCount do
                    begin
                result:=next(s[i]);
                    if result='false' then
                     exit;
                    end;
                  end;
           end;
    end;
end;
result:=next(s[i]);编译这句时提示too many actual parametes,不知是怎么回事?