我现在有这样一个函数在外部dll中 
int sqlite_get_table_printf( 
  sqlite*, 
  char *sql, 
  char ***result, 
  int *nrow, 
  int *ncolumn, 
  char **errmsg, 
  ... 
); 
如何改写成pascal风格的说明?

解决方案 »

  1.   

    //sqlite是什么类型呀?
    //假设sqlite是struct
    type
      Tsqlite=record
        ID:Integer;
        Name :PChar;
      end;
    type
      PPChar=^PChar;
      PPPChar=^PPChar;
      Psqlite=^Tsqlite;
    function sqlite_get_table_printf(sqlite:Psqlite; sql:PChar; result:PPPChar; nrow: PInteger; ncolumn :PInteger; errmsg :PPChar
    ...
    ):Integer;
      

  2.   

    //sqlite是什么类型呀?
    //假设sqlite是struct
    type
      Tsqlite=record
        ID:Integer;
        Name :PChar;
      end;
    type
      PPChar=^PChar;
      PPPChar=^PPChar;
      Psqlite=^Tsqlite;
    function sqlite_get_table_printf(sqlite:Psqlite; sql:PChar; result:PPPChar; nrow: PInteger; ncolumn :PInteger; errmsg :PPChar;Arr :Variant):Integer;
      

  3.   

    c的printf是最典型的例子!
    但是用pascal好象只能通过dynamic array或者tlist来实现。
      

  4.   

    由于pascal和c的传参的方式不同,没办法处理位置个数参数,没看到类似 Format这类的函数都用了 [] 吗?
    动态数组是个办法。
      

  5.   

    谢谢各位,找到了,这样声明
    procedure f(...);varargs;
      

  6.   

    sqlite是dll中定义的结构,没有实现细节,不管怎样,谢谢各位