I have had trouble in our main application using record properties on objects, working with native pascal scripting but not with VBScript. Some two years ago with LMD2014 and possibly earlier OS versions the record properties were working....
(I am using LMD 2017.4, under Win10)
I have gone back to one of the demo programs, namely "DelphiMapping" and example 4 therein, relating to records, and in particular system.TPoint is used as an example wrapped record (descendant class of TLMDRecordWrapper)
-----------------------------------------------------
procedure Main;
var
rec, recstr;
samerec, anotherrec;
begin
// Creating and using records:
rec := TPoint.Create;
rec.X := 3;
rec.Y := 5;
recstr := '(' + IntToStr(rec.X) + ', ' + IntToStr(rec.Y) + ')';
...
MessageList.Lines.Add('Created TPoint record: ' + recstr);
// Copying records:
samerec := rec; // Just another ref to same record object.
anotherrec := rec.Copy; // Real copy.
-----------------------------------------------------
THIS ALL WORKS
HOWEVER when I do a VBScript version,
-----------------------------------------------------
...
rec = TPoint.Create
rec.X = 3
rec.Y = 5
...
-----------------------------------------------------
and run inside the debugging demo, the create line seems to run but after assigning the properties the object is still "empty"
Am I not creating the object correctly with my VBscript syntax?
Have also tried:
rec =CreateObject("TPoint")
... and other variants but get OLE errors so assume my syntax is completely wrong with these.
Comments