EricGrange/DWScript

How to bind a script method to an object

achinastone opened this issue · 2 comments

Can i bind the DoExecute to the OnExecute property?

e.g.

TDelphiObject = class(TObject)
published
property OnExecute: TNotifyEvent;
end;

TDWSObject = class(TDelphiObject)
public
procedure DoExecute(Sender: TObject);
end;

There is no direct binding between Delphi and script code, you will have to execute scripts from a Delphi-side event handler.

Note that if the scripts are intended for end-users, it is not recommended to expose anything directly through RTTI (RTTI is not secure/safe, as most Delphi classes and components are not secure/safe)

Thanks.