ghkweon / dwscript

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

Cannot assign RTTIVariants to RTTIVariants with strong typing #425

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Setting a field AsString does not compile when assigning a value from a 
RTTIVariant. The error is raised in TConnectorWriteExpr.AssignConnectorSym 
where a string Symbol is not compatible with a RTTIVariant.

var q: RttiVariant<Data.Win.ADODB.TADOQuery>;
..
q := CreateComponent(self, 'TADOQuery');
...
q.FieldByName('CustAddr').AsString := q2.FieldByName('CustAddr').AsString;

q2 is an external global variable defined in Delphi as a SYS_RTTIVARIANT as 
follows.

    CompVar := FScriptUnit.Variables.Add;
    CompVar.Name := compName;
    CompVar.DataType := SYS_RTTIVARIANT;
    CompVar.OnReadVar := onGetVar;

procedure onGetVar(info: TProgramInfo; var value: Variant);
begin
  value := TdwsRTTIVariant.FromObject(FObj);
end;

I'm using the latest source.

Original issue reported on code.google.com by tom.robe...@gmail.com on 23 Jun 2013 at 11:58

GoogleCodeExporter commented 8 years ago
Forgot to say which line in bombs on. It's on line
q.FieldByName('CustAddr').AsString := q2.FieldByName('CustAddr').AsString;

Original comment by tom.robe...@gmail.com on 24 Jun 2013 at 12:07

GoogleCodeExporter commented 8 years ago
This issue no longer occurs in the latest DWS. 
It can be closed.

Original comment by tom.robe...@gmail.com on 2 Sep 2013 at 12:01

GoogleCodeExporter commented 8 years ago
This issue no longer occurs in the latest DWS. 
It can be closed.

Original comment by tom.robe...@gmail.com on 2 Sep 2013 at 12:01

GoogleCodeExporter commented 8 years ago

Original comment by zar...@gmail.com on 2 Sep 2013 at 7:35