1

似乎 UnitImport 程序可能以某种方式进入 cajScript/PascalScript 的开发,它可能隐藏了一些有助于理解如何实现 PascalScript 应用程序的细节。假设是这种情况,或者您想在不使用导入器的情况下编写 PascalScript 应用程序,您将如何将这样的类合并到您的脚本环境中?:

 TQuery = Class(TObject)
  private
    oSQL: TSQLQuery;
    FFirstCall: Boolean;
    function ExecSQL: Integer;
    function GetFields(iNdx: Integer): String;
    function GetFieldNames(iNdx: Integer): String;
    function GetFieldCount: Integer;
  public
    EOF: Boolean;
    Constructor Create(Owner: TComponent);
    Destructor Destroy;
    property FieldCount: Integer Read GetFieldCount;
    property FieldNames[iNdx: Integer]: String Read GetFieldNames;
    property Fields[iNdx: Integer]: String Read GetFields;
    procedure AddSQL(sSQL: String);
    procedure ExecSQL;
    function Fetch: Boolean;
  end;

我希望整理一些关于使用 PascalScript 的基本说明,这些说明可能会填补两个说明文档和新闻组留下的一些空白。

谢谢你的帮助。

4

1 回答 1

2

The Unit Importer tool works pretty well, and that class doesn't look like it would give it any trouble. What I'd do is run the class through the importer and take a look at the import code that comes out. By examining it, you can see what a good class import unit should look like, which will give you a place to start from in your attempt to learn how class importing works.

于 2009-11-22T21:04:19.413 回答