<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-cite-prefix">Le 11/09/2013 07:51, Richard Mace a
      écrit :<br>
    </div>
    <blockquote
cite="mid:CAK+KT392fLX8bUCZc8N8XVWyOrtTdpzXi8bmJS=S_3KNu7Nmpw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">Hi,</div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">Can anyone give
          me an example of adding and retrieving an integer value to a
          TTreenode via it's data property please?</div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif"><br>
        </div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">I've tried the
          below, but it doesn't seem to work.</div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif"><br>
        </div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">Set:</div>
        <div class="gmail_default">
          <div class="gmail_default">
            <font face="arial, helvetica, sans-serif">with
              tvMain.Items.AddChildObject(tvMain.Selected,'string',TObject(fUserList.Items[I].Id))
              do</font></div>
        </div>
      </div>
    </blockquote>
    <font face="arial, helvetica, sans-serif">change to:</font><br>
    <font face="arial, helvetica, sans-serif">with
      tvMain.Items.AddChildObject(tvMain.Selected,'string', <b><big>Pointer</big></b>(fUserList.Items[I].Id))
      do</font><br>
    <blockquote
cite="mid:CAK+KT392fLX8bUCZc8N8XVWyOrtTdpzXi8bmJS=S_3KNu7Nmpw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_default">
          <div style="font-family:arial,helvetica,sans-serif"><br>
          </div>
          <div style="font-family:arial,helvetica,sans-serif">
            <br>
          </div>
          <div style="font-family:arial,helvetica,sans-serif">and
            getting as, throws an exception on start:</div>
          <div>
            <div>
              <div>procedure TfrmMain.tvMainChange(Sender: TObject;
                Node: TTreeNode);</div>
              <div>begin</div>
              <div>
                  ShowMessage('Node ' + IntToStr(Integer(Node.Data)));</div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    change to:<br>
    ShowMessage('Node ' + IntToStr(<b>PtrInt</b><b><big></big></b>(Node.Data)));<br>
    <br>
    Antonio.<br>
    <blockquote
cite="mid:CAK+KT392fLX8bUCZc8N8XVWyOrtTdpzXi8bmJS=S_3KNu7Nmpw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_default">
          <div>
            <div>
              <div>end;</div>
            </div>
          </div>
          <div><br>
          </div>
          <div style="font-family:arial,helvetica,sans-serif">Thanks in
            advance</div>
          <div style="font-family:arial,helvetica,sans-serif">
            <br>
          </div>
          <div style="font-family:arial,helvetica,sans-serif">Richard</div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">--
_______________________________________________
Lazarus mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>