Ekas Software Windows Script Host Control for Delphi Help
How to operate with non-published members in script
Quick start: common questions
TekWSHControl mechanism for operating with Delphi objects based on operating with Runtime Type Information (RTTI) (and with public methods, unit routines and variables starting from version 2.5), so it can directly access only to their published properties and methods (using wrapper modules generated by expert - see related topics about calling object methods and unit routines and variables in script) . But there is very simple workaround to access any symbols of Delphi program. You just need to define proxy classes (descending from TPersistent) to represent anything you need in script environment. For example:

type

TSimpleProxyClass = class(TPersistent)

private

procedure Set_I(Value: integer);

function Get_I: integer;

published

property I: integer read Get_I write Set_I;

end;

var

I: integer;

...

procedure TSimpleProxyClass.Set_I(Value: integer);

begin

I:= Value;

end;

function TSimpleProxyClass.Get_I: integer);

begin

Result:= I;

end;

then you can create instance of TSimpleProxyClass, register it using TekWSHControl.RegisterClass and access to I variable via accordable property of this instance.

Any non-published members of classes, unit variables, procedures, functions etc. can be accessed the same way.

So the matter of way we suggest is creating some wrapper object descending from TPersistent, which will perform all needed actions in responce to appeals to its published properties and methods from script.


Ekas Software Windows Script Host Control for Delphi Help
Copyright (c)2002,2003 Ekas Software