Test the object type of TTreeNode.Data lazarus / 31-LCL ---------------------------------------------------------------------- Marion · 2021-05-05 20:23 How do I determine the object type in a TTreeNode.Data? I have tried and failed with: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i TypeOf(Node.Data^) = TypeOf(TProject) Node.Data = TypeOf(TProject) I can't find anything about this. ---------------------------------------------------------------------- jamie · 2021-05-05 20:50 First you need to check it for assignment... if Assigned(Node.Data) then  if TObject(Node.Data) is TheNameOFTheClass Then.... ---------------------------------------------------------------------- Marion · 2021-05-05 22:03 Quote from: jamie on May 05, 2021, 10:50:34 pmFirst you need to check it for assignment... if Assigned(Node.Data) then  if TObject(Node.Data) is TheNameOFTheClass Then.... Thank you so much! ---------------------------------------------------------------------- Remy Lebeau · 2021-05-05 22:24 Quote from: jamie on May 05, 2021, 10:50:34 pmFirst you need to check it for assignment... if Assigned(Node.Data) then You don't need that.  All that will do is tell you whether Data is nil or not.  Calling the 'is' operator on a nil pointer will return False (and likewise, calling the 'as' operator on a nil pointer will return a nil pointer).  So the Assigned() check is redundant.