{
Addr example
This example uses the Addr function to get the address of a numeric value that is stored as custom data in a tree node. Once the assignment has been made, changes to the entries in the NodeNumbers array can be read by dereferencing the pointers that are stored in the Data property of the Tree nodes.
} 
var
  I : Integer;
  NodeNumbers: array [0 .. 100] of Integer;
 begin
  with TreeView1 do
  begin
    for I := 0 to Items.Count - 1 do
    begin
      NodeNumbers[I] := CalculateValue(Items[I]);
      Items[I].Data := Addr(NodeNumber[I]);
    end;
  end;
end; 
