<div>Dear Kyley,</div>
<div> </div>
<div>Thanks for that I've cranked up the D4 help, and D7 and between them there is a lot. And the PDF developer's guides.</div>
<div> </div>
<div>Delphi Help had an amazing team once. I traded emails with a lady there years ago who I think used to run documentation. <strong>DevCo should get her back</strong>!</div>
<div> </div>
<div>They were an amazing bunch of people, but I don;t think Borland realised at the time what an asset theiur staff actually were, and worth investing more money in.</div>
<div> </div>
<div>Instead the short sighted prunning cutters came out!</div>
<div> </div>
<div>Thanks again,</div>
<div>Paul<br><br> </div>
<div><span class="gmail_quote">On 20/05/06, <b class="gmail_sendername">Kyley Harris</b> <<a href="mailto:kyley@harrissoftware.com">kyley@harrissoftware.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div lang="EN-US" vlink="blue" link="blue">
<div>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Halt is utterly final, and no cleanup is required. Halting is the same as doing endprocess in task manager. Everything will be wiped clean to the operating system capability. Unsaved stuff is lost etc etc.
</span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Halt is generally not an ideal way to kill off an application. </span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> </span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">The help is from Delphi 7 hlp. After Delphi 7 IMHO the help is pathetic and useless. Even d7 is missing help from older versions that was more relevant and useful. God knows who wrote their help system, but he/she should be hit on the head.
</span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> </span></font></p>
<div>
<div style="TEXT-ALIGN: center" align="center"><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt">
<hr align="center" width="100%" size="2">
</span></font></div>
<p><b><font face="Tahoma" size="2"><span style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</span></font></b><font face="Tahoma" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:delphi-bounces@ns3.123.co.nz" target="_blank">
delphi-bounces@ns3.123.co.nz</a> [mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:delphi-bounces@ns3.123.co.nz" target="_blank">delphi-bounces@ns3.123.co.nz</a>] <b><span style="FONT-WEIGHT: bold">
On Behalf Of </span></b>Paul A Norman<br><b><span style="FONT-WEIGHT: bold">Sent:</span></b> Saturday, 20 May 2006 11:06 a.m.</span></font></p></div>
<div><span class="e" id="q_10b4fd023edb8f84_1"><br><b><span style="FONT-WEIGHT: bold">To:</span></b> NZ Borland Developers Group - Delphi List<br><b><span style="FONT-WEIGHT: bold">Subject:</span></b> Re: [DUG] Usage - initialization and finalization
</span></div>
<div>
<p></p></div></div>
<div><span class="e" id="q_10b4fd023edb8f84_3">
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt"> </span></font></p>
<div>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt">Dear Kyley,</span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt"> </span></font></p></div>
<div>
<p><font face="Times New Roman" color="#3366ff" size="3"><span style="FONT-SIZE: 12pt; COLOR: #3366ff">" It contains statements that are executed when the main program terminates<br>(unless the Halt procedure is used to terminate the program). Use the
<br>finalization section to free resources that are allocated in the <br>initialization section"</span></font><br><br>Thats the sort of stuff I was looking for in the help systrem. Which version of Delphi (help) was that in?
</p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt">So far I have not found it in D2005.</span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt"> </span></font></p></div>
<div>
<p><font face="Times New Roman" color="#3366ff" size="3"><span style="FONT-SIZE: 12pt; COLOR: #3366ff">"As per the help file, which it seems many have not read.. "</span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt">You say that Finalization does not happen on halt.</span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt">Is there anything that can be caused to do cleanup if halt is executed? Or is it utterly final?</span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt"> </span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt">Paul</span></font></p></div>
<div>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt"> </span></font></p></div>
<div>
<p><span><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt">On 20/05/06, <b><span style="FONT-WEIGHT: bold">Todd Martin</span></b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:toddm@kol.co.nz" target="_blank">
toddm@kol.co.nz</a>> wrote:</span></font></span> </p>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt">Hi Kyley<br><br>There is another option. The double check locking pattern. Once instantiated<br>the critical section is no longer used. <br><br>var<br>
SingletonInstance : TSingletonObject;<br><br>function GetSingletonInstance : TSingletonObject;<br>begin<br>if (SingletonInstance= nil) then<br>begin<br> CriticalSection.Enter;<br> try<br> if (SingletonInstance= nil) then
<br> begin<br> SingletonInstance:= TSingletonObject.Create;<br> end;<br> finally<br> CriticalSection.Leave;<br> end;<br>end;<br><br>Result := SingletonInstance;<br>end;<br><br><br>----- Original Message -----
<br>From: "Kyley Harris" <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:kyley@harrissoftware.com" target="_blank">kyley@harrissoftware.com</a>><br>To: "NZ Borland Developers Group - Delphi List" <
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:delphi@ns3.123.co.nz" target="_blank">delphi@ns3.123.co.nz </a>><br>Sent: Friday, May 19, 2006 4:52 PM<br>Subject: RE: [DUG] Usage - initialization and finalization
<br><br><br>> Thanks. Hadn't thought of that before. It is of course quite possible<br>> for it to be constructed 2 times. Going back to that code sample I <br>> posted for observation I use this method for creating a Critical
<br>> Section. This would probably be a good place to use that seeing as I use<br>> that in a very threaded environment.<br>><br>> -----Original Message----- <br>> From: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:delphi-bounces@ns3.123.co.nz" target="_blank">
delphi-bounces@ns3.123.co.nz</a> [mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:delphi-bounces@ns3.123.co.nz" target="_blank">delphi-bounces@ns3.123.co.nz</a>]<br>> On Behalf Of Jeremy North
<br>> Sent: Friday, 19 May 2006 2:29 p.m.<br>> To: NZ Borland Developers Group - Delphi List<br>> Subject: Re: [DUG] Usage - initialization and finalization<br>><br>> An alternate and thread safe way to perform this operation is to use
<br>> InterlockedCompareExchange. <br>><br>> It is possible (although not very probable) to have FList created<br>> twice without using InterlockedCompareExchange. Probably not worth the<br>> extra effort though.
<br>><br>> ms-help://borland.bds4/dllproc/base/interlockedcompareexchange.htm <br>><br>> This technique is implemented in the TPrivateHeap class in the<br>> PrivateHeap unit. It was originally written by Hallvard Vassbotn. If
<br>> you are interested in the inner workings of Delphi and the Compiler, <br>> you should read his blog (<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://hallvards.blogspot.com/" target="_blank">
http://hallvards.blogspot.com/</a>).<br>><br>> For the OP I would minimize the use of the Initialization section to<br>> cases where you really need it. Otherwise your unit cannot be smart <br>> linked out.<br>
><br>> /// code below<br>><br>> unit Unit4;<br>><br>> interface<br>><br>> uses<br>> Windows<br>> , Classes<br>> , SysUtils<br>> ;<br>><br>> function GetList: TList; <br>
><br>> implementation<br>><br>> var<br>> FList: TList;<br>><br>> function GetList: TList;<br>> var<br>> lList: TList;<br>> begin<br>> if FList = nil then<br>> begin<br>> lList :=
TList.Create;<br>> if InterlockedCompareExchange(Integer(FList), Integer(lList), 0) <><br>> 0 then<br>> lList.Free;<br>> end;<br>> result := FList;<br>> end;<br>><br>> initialization
<br>><br>> finalization<br>> FreeAndNil(FList);<br>><br>> end.<br>><br>> _______________________________________________<br>> Delphi mailing list<br>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Delphi@ns3.123.co.nz" target="_blank">
Delphi@ns3.123.co.nz </a><br>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://ns3.123.co.nz/mailman/listinfo/delphi" target="_blank">http://ns3.123.co.nz/mailman/listinfo/delphi</a><br>><br>>
<br>><br>> _______________________________________________<br>> Delphi mailing list <br>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Delphi@ns3.123.co.nz" target="_blank">Delphi@ns3.123.co.nz
</a><br>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://ns3.123.co.nz/mailman/listinfo/delphi" target="_blank">http://ns3.123.co.nz/mailman/listinfo/delphi</a><br>><br>><br>><br>> --
<br>> No virus found in this incoming message.<br>> Checked by AVG Free Edition.<br>> Version: 7.1.392 / Virus Database: 268.5.6/340 - Release Date: 15/05/2006<br>><br>><br><br><br><br>--<br>No virus found in this outgoing message.
<br>Checked by AVG Free Edition.<br>Version: 7.1.392 / Virus Database: 268.5.6/340 - Release Date: 15/05/2006<br><br>_______________________________________________<br>Delphi mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Delphi@ns3.123.co.nz" target="_blank">
Delphi@ns3.123.co.nz</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://ns3.123.co.nz/mailman/listinfo/delphi" target="_blank">http://ns3.123.co.nz/mailman/listinfo/delphi</a></span></font></p></div>
<p><font face="Times New Roman" size="3"><span style="FONT-SIZE: 12pt"> </span></font></p></span></div>
<div></div></div></div><br>_______________________________________________<br>Delphi mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Delphi@ns3.123.co.nz">Delphi@ns3.123.co.nz</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://ns3.123.co.nz/mailman/listinfo/delphi" target="_blank">http://ns3.123.co.nz/mailman/listinfo/delphi</a><br><br><br></blockquote></div><br>