Einzelnen Beitrag anzeigen

Benutzerbild von geskill
geskill

Registriert seit: 17. Feb 2007
Ort: NRW
420 Beiträge
 
Delphi 2010 Professional
 
#1

FastScript - dem Script ein Interface hinzufügen

  Alt 29. Dez 2009, 22:19
Hallo,
kurz vorweg, ich bin gerade am Testen dieser Komponente, eigentlich gefällt sie mir ganz gut, da der Hersteller auch ein Rabatt für seine Komponenten übers neue Jahr gibt, wäre es ein guter Kaufgrund.

Leider, aber auch verständlich da gerade Feiertage, sind ist in dem Support Forum nicht viel los.

Mein Problem besteht darin, dass ich im Programm einige Interfaces habe, die ich auch direkt dem User des Scripts zur Verfügung stellen möchte.

Aus der Dokumentation konnte ich hier entnehmen:
Zitat:
Adding an object to the script
To add an object to a script, call the TfsScript.AddObject method. The first parameter
is the name of the object, the second one is the object itself.
fsScript1.AddObject('Button1', Button1); If object has an unregistered type, you have to register it before calling AddObject:
Delphi-Quellcode:
fsScript1.AddClass(TForm1, 'TForm');
fsScript1.AddObject('Form1', Form1);
[...]

Adding a class to the script
To add a class to a script, call the TfsScript.AddClass method. The first parameter is
the class type, the second one is the name of the parent class.
Delphi-Quellcode:
type
TMyClass = class(TObject)
...
end;

fsScript1.AddClass(TMyClass, 'TObject');
This will make all the published properies of this class available. If you want to make
this class available for all the scripts, it is recommended to add this class to the
fsGlobalUnit which is a global ancestor of all the scripts.
Vielleicht hat ja jemand schon derartiges Vorgehabt und hätte eine Idee für mich. Alternativen wüsste ich auch nicht, würde auch gerne bei dieser bleiben; benutze den JScript Dialekt.

Grüße
Sebastian
  Mit Zitat antworten Zitat