I'd like to get some compile time checking on my scripts so exposing my global variables as just RTTIVariant is not desirable. I'm exposing the Screen object to script using the following code.
Delphi side global variable creation
var CompVar : TdwsGlobal;
..
CompVar := dwsUnit1.Variables.Add;
CompVar.Name := 'Screen';
CompVar.DataType := 'RttiVariant';
CompVar.OnReadVar := onGetScreen;
procedure onGetScreen(info: TProgramInfo; var value: Variant);
begin
value := TdwsRTTIVariant.FromObject(Screen);
end;
What I would like to do is replace 'RttiVariant' with 'RttiVariant<Vcl.Forms.TScreen>'. Script is not happy with strong RTTIVariant types being used on the Delphi side but it is happy on the scripting side. Anyway of achieving this?