ghkweon / dwscript

Automatically exported from code.google.com/p/dwscript
0 stars 0 forks source link

Enhancement - Adding strongly typed RttiVariant from Delphi to expose to DWS script #437

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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.

Original issue reported on code.google.com by tom.robe...@gmail.com on 11 Sep 2013 at 9:56

GoogleCodeExporter commented 8 years ago

Original comment by zar...@gmail.com on 24 Sep 2013 at 6:36