type
  forbidsong = packed record
    songid: Longword;
    forbidate: array[0..11] of Char;
  end;
  Pforbidsong = ^forbidsong;
  PPforbidsong = ^Pforbidsong;  ccddt = packed record
    aip: array[0..31] of Char; 
    bip: array[0..31] of Char;     
    flag: Integer;   
  end;
  Pccddt = ^ccddt;function recvforbidlist(vodclient: Pccddt; var fcount: Integer): PPforbidsong;这个函数返回的是一个结果集
如何获取其中的一条记录?请各位高手解答下

解决方案 »

  1.   

    function recvforbidlist(vodclient: Pccddt; var fcount: Integer): PPforbidsong;
    var
      iLoop  : Integer;
      AClient: ccddt;
    begin
      for iLoop := 1 to fcount do
      begin
        AClient := vodclient^;
        //此处可处理AClient这个记录变量的内容
        ......
        //下一个记录
        inc(vodclient);
      end;
    end;
      

  2.   

    这样好象不对哦
    vodclient存储的服务器地址啊
      

  3.   

    函数名:struct forbisong ** recvforbidlist( struct ccddt *vodclient, int *fcount)
    Int *fcount  返回数记录数量
                  返回值:
    NULL  为空
    指针   结果集
      

  4.   

    var
      AClient      : Pccddt;
      APPforbidsong: PPforbidsong;
      Aforbidsong  : forbidsong;
      iCount       : Integer;
      iLoop        : Integer;
    begin
      //给AClient赋值
      .......  //调用函数
      APPforbidsong := recvforbidlist(AClient, iCount);
      for iLoop := 1 to iCount do
      begin
        Aforbidsong := APPforbidsong^^;
        //开始处理
        ......
        //下一条
        inc (APPforbidsong^);
      end;
    end;
      

  5.   

    //楼上的代码比较接近,但据我理解该是这样
    procedure TForm1.Button1Click(Sender: TObject);
    var
      AClient      : Pccddt;
      APPforbidsong: PPforbidsong;
      Aforbidsong  : Pforbidsong;
      iCount       : Integer;
      iLoop        : Integer;
    begin
      APPforbidsong := recvforbidlist(AClient, iCount);
      for iLoop := 1 to iCount do
      begin
        Aforbidsong := APPforbidsong^;
        //Aforbidsong^.forbidate
        inc(APPforbidsong); //<<<<<
      end;
    end;