On Tue, 23 Nov 2010 15:41:20 -0600
Marco Aurelio Ramirez Carrillo <stardev.mrami...@gmail.com> wrote:

> Hi.
> I'm working witha TTreeview, and trying to assign a object to a
> TTreeNode.data property:
> 
> <code>
> MyTreeNode := myTreeview.add(nil, "MyTreeNode");
> 
> // any "TObject" descendant class
> MyObject = MyClass.Create();
> 
> // all of these, generate a syntax/semantic error:
> 
> // no typecasting
> MyTreeNode.Data := MyObject;

This works here.
Please provide a more complete example.


> // typecasting lowercase
> MyTreeNode.Data := pointer(MyObject);
> // typecasting capital
> MyTreeNode.Data := Pointer(MyObject);
> // typecasting with address operator

Pascal types are case insensitive.


> MyTreeNode.Data := pointer(@MyObject);

Simply wrong.

Mattias

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to