How to generate ap_system.pas?

Hello Forum,

I try to generate the ap_system.pas for Tokyo 10.2.2, but the get parsing error at 847,7

      [Volatile] FLockCount: Integer;    

Anyone successfully created the import files for Tokyo 10.2.2 ?

We would like to use method "TDirectory.GetFileSystemEntries" which is implemented in system.pas.


The import tool can't parse attributes. The import tool is not recommended these days, as now there is the enchanted RTTI in newer Delphi versions and you can use DefineClassByRTTI to automatically register methods. 

Also to register specific methods like this, it's also easy to just register a define for that method specifically.
Hello Wagner,

Will the Import tool get updated to support newer features of Delphi?



Hi Yogesh,

With the new RTTI in recent Delphi versions, we have unfortunately no plans to improve the import tool to support the new Delphi language features. It's become a legacy tool.

Hello Wagner,

thank you for your suggestion to use DefineClassByRTTI.

But "TDirectory" in System.IOUtils is defined as "TDirectory = record".

So I tried to use this statement:

This compiles fine. But when I use TDirectory.GetFiles('c:\temp') from within the script-engine, the error:
Exception in classe EatScripterRuntime with message "RUNTIME ERROR File library FormUnit: Cannot execute record method. No tyoe infor available.

Did I something wrong or is your suggestion not working?


Advanced records (class methods, for example) are not supported. In this case you will have to register it manually, defining a fake class in scripter and then defining each method manually, as a wrapper around the real class:

procedure TForm3.Button1Click(Sender: TObject);
  IDEScripter1.SourceCode := IDEMemo1.Lines;

procedure TForm3.FormCreate(Sender: TObject);
  C: TatClass;
  C := IDEScripter1.DefineClass(TObject, 'TDirectory');
  C.DefineMethod('IsEmpty', 1, tkEnumeration, nil, IsEmptyProc, True);

Thank you,

I would prefer a proper import tool.
The way with RTTI seems to have a lot of limitations.

You may place the importtool at, so the community can improve it?


Full source code of import tool is available under the "demos" folder.