data pointer

Author Message
john 09/30/2015 09:13 pm
Sorry for the dumb question, currently saving key information to a pointer.. ; however when getting the save pointer data I get a syntax error. must be doing something stupid.
saving data... this works

define pointer

type
metatreerec = ^TMetaRec;
TMetaRec = record
Guidid: string;
rtype: string;
end;


save data

new(metatreerec1);
metatreerec1^.Guidid := datamodule3.getdomaincapsoftcds1.FieldByName('software_guid').AsString;
metatreerec1^.rtype := 'software';
n2.Data := metatreerec1;


on retrieving pointer I get error .

[dcc32 Error] Gpixclass.pas(145): E2066 Missing operator or semicolon


procedure TGPixFrame.MetaTree2Select(Sender: TObject; Node: TMTNode);
var metatreerec1: metatreerec;
begin
if metatreerec1(metatree2.ActiveItem.data)^.rtype = 'software' then
begin

end;
Oleg Chernavin 10/01/2015 06:26 am
Please change the line to:

if TMetaRec(metatree2.ActiveItem.data)^.rtype = 'software' then

Best regards,
Oleg Chernavin
MP Staff