<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Am 11/03/2012 03:26 PM, schrieb Edgar
      J. De Cleene:<br>
    </div>
    <blockquote cite="mid:CCBABE13.1273A%25edgardec2005@gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html;
        charset=US-ASCII">
      <title>About a object life</title>
      <span>Folks:<br>
        <br>
        I wish know how old a object is.<br>
        <br>
        Any have code for this ?<br>
        <br>
        Thanks in advance<br>
        <br>
        Edgar</span>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">
</pre>
    </blockquote>
    <br>
    <blockquote cite="mid:CCBABE13.1273A%25edgardec2005@gmail.com"
      type="cite">
    </blockquote>
    For existing objects, it's impossible to know how old they are.<br>
    For new objects, you can store a creation timestamp. Since this is
    very dependent on your actual needs, there is probably no
    ready-to-use code, but the functionality is really simple (assuming
    you have an instance variable creationTime):<br>
    <br>
    initialize<br>
    &nbsp;&nbsp;&nbsp; super initialize.<br>
    &nbsp;&nbsp;&nbsp; creationTime := DateAndTime now.<br>
    <br>
    age<br>
    &nbsp;&nbsp;&nbsp; ^DateAndTime now - creationTime<br>
    <br>
    Cheers,<br>
    Hans-Martin<br>
  </body>
</html>