<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = 
"urn:schemas-microsoft-com:vml" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word" xmlns:st1 = 
"urn:schemas-microsoft-com:office:smarttags"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1543" name=GENERATOR><!--[if !mso]>
<STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]--><o:SmartTagType 
namespaceuri="urn:schemas-microsoft-com:office:smarttags" 
name="place"></o:SmartTagType><o:SmartTagType 
namespaceuri="urn:schemas-microsoft-com:office:smarttags" 
name="PersonName"></o:SmartTagType><!--[if !mso]>
<STYLE>
st1\:*{behavior:url(#default#ieooui) }
</STYLE>
<![endif]-->
<STYLE>
<!--
 /* Font Definitions */
 @font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:Arial;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</STYLE>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US vLink=purple link=blue bgColor=white>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>If you had looked at the code Kyley posted last 
week (Donation and Discussion), you would have seen an example of where 
initialization and finalization can be used to good effect. See attached 
code!</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>Todd.</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=paul.a.norman@gmail.com href="mailto:paul.a.norman@gmail.com">Paul A 
  Norman</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=delphi@ns3.123.co.nz 
  href="mailto:delphi@ns3.123.co.nz">NZ Borland Developers Group - Delphi 
  List</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, May 19, 2006 4:04 PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [DUG] Usage - initialization 
  and finalization</DIV>
  <DIV><BR></DIV>
  <DIV>Thanks for all of that everybody.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Kyely, the information on scope, and also the non-existance yet of the 
  Application object during <STRONG>Initialization</STRONG> is very helpful 
  thanks.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>"<SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">You don't 
  always have to use initialization to create and finalize to destroy. That 
  would be very resource hungry."</SPAN></DIV>
  <DIV>&nbsp;</DIV>
  <DIV>I was thinking of it as an alternative, like&nbsp;<STRONG>Initialization 
  </STRONG>as the point to create gloabl UNIT wide VAR&nbsp;.TstringLists etc .. 
  instead of during .onFormCreate, and for freeing stringlists etc .. during 
  <STRONG>Finalization</STRONG> instead of during 
  .<STRONG>onDestroy</STRONG></DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Reason being . . </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>I was wondering whether there are any circumstances where using 
  Finilization to .<STRONG>free</STRONG> objects is more reliable than 
  .<STRONG>ondestroy </STRONG>? </DIV>
  <DIV>Is Finalization called after Tform.<STRONG>onDestroy</STRONG>, or does it 
  failsafe even if onDestroy fails for some system 
reason?<BR><BR>Paul</DIV></BLOCKQUOTE></FONT></DIV></BODY></HTML>