dwscript - Delphi Web Script: How to call a Script Function from Delphi Code within an Execution Context? -
imaging scripting code:
procedure a; begin calltodelphi; end; procedure b; begin // end;
i have exposed procedure "calltodelphi" script. when called, i'm script in delphi code. want call script procedure "b" delphi code. think must hidden in idwsprogramexecution-context. didn't found yet. i'm looking that:
procedure calltodelphi; begin exec.invoke('b', []); // exec idwsprogramexecution end;
is somehow possible?
what you're looking iinfo interface can used as
exec.info.func['b'].call([])
there more samples in http://code.google.com/p/dwscript/wiki/firststeps (scroll down functions), , usage code in unit tests (udwsunittests notably, see callfunc method).
the iinfo serves delphi-side primary way query rtti, invoke functions, get/set variables directly, instantiate script-side objects, etc. of sample code in unit tests though.
Comments
Post a Comment