Question

It seems like the UnitImport program maybe came along some ways into the development of cajScript/PascalScript and it may hide some of the details that would help provide an understanding of how to implement a PascalScript application. Assuming that is the case or that you wanted to write a PascalScript application without using the importer, how would you incorporate a class like this into your scripting environment?:

 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;

I'm hoping to put together some basic notes on using PascalScript that might fill in some of the gaps left by the two instruction documents and the newsgroups.

Thanks for any help.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top