I want to associate some extra info with a TDiagramBlock, just a simple list of Name/Value pairs (i.e. a TStringList). I thought I should be able to use the TDiagramBlock.Obj property for this but I can't work out how. I have tried all sorts of combinations of create, assign etc. but I always get Access Violations at some point.
Can someone tell me a) is the .Obj the right place to do this, b) if so, how? or c) if not how should I do this?
(some of) My attempts:
with (MyDiagramBlock.obj as TStringList) do
MyStringList : TStringList;
(MyDiagramBlock.obj as TStringList).assign(MyStringList);
Yes, it's the correct way, but Obj is nil by default, you should assign a value to it:
// setting DiagramBlock.Obj := SomeExistingStringList; // retrieving TheStringListIsBack := DiagramBlock.Obj as TStringList;
Thanks Wagner, I'll try again tomorrow....