DWS 可以从样品单元调用函数吗?例如:
FExecution.Info.Func['Test.ClickProc'].Call(AParams); (This is not working)
FExecution - IdwsProgramExecution;
脚本代码中声明的函数:
unit Test;
Uses UTestUnit;
procedure TestFunc(LParam: string);
begin
ShowMessage(LParam);
end;
procedure ClickProc(Sender: TObject);
begin
ShowMessage('DWS');
end;
var S: TStringList;
var btn: TButton;
begin
btn := TButton.Create(MainForm);
btn.OnClick := ClickProc;
btn.Parent(MainForm);
end.
此示例中的 ClickProc。