﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.howtodothings.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>HowToDoThings.com Recent Delphi Articles</title>
 <link>http://www.howtodothings.com/computers/c39-delphi.html/view-all</link>
 <description>A list of recent articles by category as Teasers.</description>
 <language>en</language>
<item>
 <title>Purchase order lines</title>
 <link>http://www.howtodothings.com/computers/a1516-purchase-order-lines.html</link>
 <description>&lt;p&gt;When creating an association in ECO you are not guaranteed the order in which the objects at the end of the association will be presented.&amp;nbsp; For this reason ECO provides a Boolean &amp;quot;ordered&amp;quot; property on association ends.&lt;/p&gt;
&lt;p&gt; When you set Ordered = True in your model and then generate your database, ECO will create an additional column in your database identifying the sequence of the objects.&lt;/p&gt;
&lt;p&gt; I have just been creating SalesInvoice / SalesInvoiceLine classes and chose to have an ordered association, basically because it is standard industry practise to identify each line of an Invoice/Order with a sequencial number, making it easily identifyable when discussing it.&lt;/p&gt;
&lt;p&gt; It would have been nice if I could have used an OCL derived attribute with an expression similar to this:&lt;/p&gt;
&lt;p&gt;this.SalesInvoice.lines-&amp;gt;indexOf(self)&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a1516-purchase-order-lines.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a1516-purchase-order-lines.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Tue, 23 Aug 2005 05:23:00 -0500</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">638 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Application.ProcessMessages replacement</title>
 <link>http://www.howtodothings.com/computers/a1514-applicationprocessmessages-replacement.html</link>
 <description>&lt;p&gt;Not only is Application.ProcessMessages quite long to type, often extra functionality needs to be called when its used.&amp;nbsp; To this end I have created two basic wrappers which can be used in its place:&lt;/p&gt;
&lt;p&gt; ...&lt;/p&gt;
&lt;p&gt; procedure ProcessMsg(); overload;&lt;br /&gt; procedure ProcessMsg(const SleepFor: Word); overload;&lt;/p&gt;
&lt;p&gt; implementation&lt;/p&gt;
&lt;p&gt; procedure ProcessMsg();&lt;br /&gt; begin&lt;br /&gt; &amp;nbsp; ProcessMsg(0);&lt;br /&gt; end;&lt;/p&gt;
&lt;p&gt; procedure ProcessMsg(const SleepFor: Word); overload;&lt;br /&gt; begin&lt;br /&gt; &amp;nbsp; Application.ProcessMessages();&lt;br /&gt; &amp;nbsp; Sleep(SleepFor);&lt;br /&gt; end;&lt;/p&gt;
&lt;p&gt; ...&lt;/p&gt;
&lt;p&gt; Now instead of writing Application.ProcessMessages(); in your code you can write ProcessMsg(); instead.&amp;nbsp; And in the future you can extend what happens around Application.ProcessMessages calls without visiting lots of different areas of your code.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a1514-applicationprocessmessages-replacement.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a1514-applicationprocessmessages-replacement.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Mon, 15 Aug 2005 06:46:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">636 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>How to retrieve AutoInc Values with BDP in Delphi 2005</title>
 <link>http://www.howtodothings.com/computers/a1513-how-to-retrieve-autoinc-values-with-bdp-in-delphi-2005.html</link>
 <description>&lt;p&gt;In this article I’ll use the term “Identity” interchangeably to note Auto generated  (from RDMS) values usually for a column representing the primary key of a table. These are called “sequences” in Oracle and “generators”  in Interbase.&lt;br /&gt; Actually, there are 3 options to get the identity value back using ADO .NET in general:
&lt;ol&gt;
&lt;li&gt;Use a batch query (the database obviously has to support this)&lt;/li&gt;
&lt;li&gt;Use a stored procedure (as the Insert command) having as an output parameter the “Identity” value (this is the fastest and thus recommended method)&lt;/li&gt;
&lt;li&gt;Handle Adapter&#039;s RowUpdated /RowUpdating event and issue a &amp;quot;SELECT @@IDENTITY &amp;quot; (in case of SQL Server) query in code in this event handler (slowest) &lt;/li&gt;
&lt;/ol&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a1513-how-to-retrieve-autoinc-values-with-bdp-in-delphi-2005.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a1513-how-to-retrieve-autoinc-values-with-bdp-in-delphi-2005.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Sun, 14 Aug 2005 14:42:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">635 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Parameter exists</title>
 <link>http://www.howtodothings.com/computers/a1512-parameter-exists.html</link>
 <description>&lt;p&gt;You will need the function in this article (&lt;a href=&quot;http://www.howtodothings.com/ViewArticle.aspx?Article=760&quot; title=&quot;http://www.howtodothings.com/ViewArticle.aspx?Article=760&quot;&gt;http://www.howtodothings.com/ViewArticle.aspx?Article=760&lt;/a&gt;) to get this working properly&lt;/p&gt;
&lt;p&gt; function ParamExists(const ParamName: string): Boolean;&lt;br /&gt; var&lt;br /&gt; &amp;nbsp; S: string;&lt;br /&gt; begin&lt;br /&gt; &amp;nbsp; Result := GetParameterValue(ParamName, [&#039;/&#039;, &#039;-&#039;], &#039;:&#039;, S);&lt;br /&gt; end;&lt;/p&gt;
</description>
 <comments>http://www.howtodothings.com/computers/a1512-parameter-exists.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Wed, 10 Aug 2005 00:55:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">634 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Get command line parameters</title>
 <link>http://www.howtodothings.com/computers/a1511-get-command-line-parameters.html</link>
 <description>&lt;p&gt;(* GetParameterValue&lt;/p&gt;
&lt;p&gt; GetParameterValue will return the value associated with a parameter name in the form of&lt;/p&gt;
&lt;p&gt; /paramname:paramvalue&lt;br /&gt; -paramname:paramvalue&lt;/p&gt;
&lt;p&gt; and&lt;/p&gt;
&lt;p&gt; /paramname&lt;br /&gt; -paramname&lt;/p&gt;
&lt;p&gt; ParamName - Name of the parameter (paramname)&lt;br /&gt; SwitchChars - Parameter switch identifiers (/ or -)&lt;br /&gt; Seperator - The char that sits between paramname and paramvalue (:)&lt;br /&gt; Value - The value of the parameter (paramvalue) if it exists&lt;/p&gt;
&lt;p&gt; Returns - Boolean, true if the parameter was found, false if parameter does not exist&lt;/p&gt;
&lt;p&gt; typical usage&lt;/p&gt;
&lt;p&gt; Parameter&lt;br /&gt; -P=c:\temp\&lt;br /&gt; -S&lt;/p&gt;
&lt;p&gt; GetParameterValue(&#039;p&#039;, [&#039;/&#039;, &#039;-&#039;], &#039;=&#039;, sValue);&lt;/p&gt;
&lt;p&gt; sValue will contain c:\temp\&lt;/p&gt;
&lt;p&gt; *)&lt;br /&gt; function GetParameterValue(const ParamName: string; SwitchChars: TSysCharSet;&lt;br /&gt; &amp;nbsp; Seperator: Char; var Value: string): Boolean;&lt;br /&gt; var&lt;br /&gt; &amp;nbsp; I, Sep: Longint;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a1511-get-command-line-parameters.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a1511-get-command-line-parameters.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Wed, 10 Aug 2005 00:53:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">633 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Get the size of a file</title>
 <link>http://www.howtodothings.com/computers/a1510-get-the-size-of-a-file.html</link>
 <description>&lt;p&gt;function GetFileSize(const FileName: string): Integer;&lt;br /&gt; var&lt;br /&gt; &amp;nbsp; sr: TSearchRec;&lt;br /&gt; begin&lt;br /&gt; &amp;nbsp; Result := 0;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; if FindFirst(FileName, faAnyFile, sr) = 0 then&lt;br /&gt; &amp;nbsp; begin&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; Result := sr.Size;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; FindClose(sr);&lt;br /&gt; &amp;nbsp; end;&lt;br /&gt; end;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
</description>
 <comments>http://www.howtodothings.com/computers/a1510-get-the-size-of-a-file.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Wed, 10 Aug 2005 00:52:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">632 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>BaseForm class</title>
 <link>http://www.howtodothings.com/computers/a1509-baseform-class.html</link>
 <description>&lt;p&gt;Have you ever found yourself adding the same code to different forms?&amp;nbsp; Well now you can use the following as a base class for all forms.&lt;/p&gt;
&lt;p&gt; ===============&amp;nbsp;&amp;nbsp; BEGIN CODE&amp;nbsp; ======================&lt;br /&gt; unit BaseForm;&lt;/p&gt;
&lt;p&gt; interface&lt;/p&gt;
&lt;p&gt; uses SysUtils, Classes, Forms, Windows;&lt;/p&gt;
&lt;p&gt; type&lt;br /&gt; &amp;nbsp; TBaseForm = class(TForm)&lt;br /&gt; &amp;nbsp; protected&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; function IsModal(): Boolean;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; procedure KeyDown(var Key: Word; Shift: TShiftState); override;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; procedure ShowError(E: Exception);&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; function MsgBox(Msg: string;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uType: Integer = MB_OK or MB_ICONSTOP): Integer; overload;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; function MsgBox(Msg, MsgCaption: string;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uType: Integer = MB_OK or MB_ICONSTOP): Integer; overload;&lt;br /&gt; &amp;nbsp; end;&lt;/p&gt;
&lt;p&gt; implementation&lt;/p&gt;
&lt;p&gt; uses Controls;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a1509-baseform-class.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a1509-baseform-class.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Wed, 10 Aug 2005 00:51:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">631 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>MsgBox function</title>
 <link>http://www.howtodothings.com/computers/a1508-msgbox-function.html</link>
 <description>&lt;p&gt;Personally I find both the WinAPI MessageBox and Application.MessageBox and MessageDlg functions cludgy and always add the following function to every app.&lt;/p&gt;
&lt;p&gt; function MsgBox(const Msg: string;&lt;br /&gt; &amp;nbsp; MsgType: Integer = MB_OK or MB_ICONSTOP): Integer;&lt;br /&gt; begin&lt;br /&gt; &amp;nbsp; Result := MessageBox(Application.Handle, PChar(Msg),&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; PChar(Application.Title), MsgType);&lt;br /&gt; end;&lt;/p&gt;
&lt;p&gt; requires that Forms.pas is in the uses clause.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
</description>
 <comments>http://www.howtodothings.com/computers/a1508-msgbox-function.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Wed, 10 Aug 2005 00:46:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">630 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Remove ReadOnly flag from file</title>
 <link>http://www.howtodothings.com/computers/a1507-remove-readonly-flag-from-file.html</link>
 <description>&lt;p&gt;The following function will attempt to remove the read only flag on a file, you will need the function in this article (&lt;a href=&quot;http://www.howtodothings.com/ViewArticle.aspx?Article=755&quot; title=&quot;http://www.howtodothings.com/ViewArticle.aspx?Article=755&quot;&gt;http://www.howtodothings.com/ViewArticle.aspx?Article=755&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt; function RemoveReadOnly(const FileName: string): Boolean;&lt;br /&gt; begin&lt;br /&gt; &amp;nbsp; (* Assume Success *)&lt;br /&gt; &amp;nbsp; Result := True;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; (* Make sure the file is read only before&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; we try and change the attributes *)&lt;br /&gt; &amp;nbsp; if (IsReadOnly(FileName)) then&lt;br /&gt; &amp;nbsp; begin&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; SetFileAttributes(PChar(FileName), FILE_ATTRIBUTE_NORMAL);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; Result := not IsReadOnly(FileName);&lt;br /&gt; &amp;nbsp; end;&lt;br /&gt; end;&lt;/p&gt;
</description>
 <comments>http://www.howtodothings.com/computers/a1507-remove-readonly-flag-from-file.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Wed, 10 Aug 2005 00:43:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">629 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Detect if file is ReadOnly</title>
 <link>http://www.howtodothings.com/computers/a1506-detect-if-file-is-readonly.html</link>
 <description>&lt;p&gt;The following function will return True if a file is read only.&lt;/p&gt;
&lt;p&gt; function IsReadOnly(const FileName: string): Boolean;&lt;br /&gt; var&lt;br /&gt; &amp;nbsp; sr: TSearchRec;&lt;br /&gt; begin&lt;br /&gt; &amp;nbsp; (* Assume not read only *)&lt;br /&gt; &amp;nbsp; Result := False;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; if FindFirst(FileName, faAnyFile, sr) = 0 then&lt;br /&gt; &amp;nbsp; begin&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; Result := (sr.Attr and faReadOnly) &amp;lt;&amp;gt; 0;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; FindClose(sr);&lt;br /&gt; &amp;nbsp; end;&lt;br /&gt; end;&lt;/p&gt;
</description>
 <comments>http://www.howtodothings.com/computers/a1506-detect-if-file-is-readonly.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Wed, 10 Aug 2005 00:41:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">628 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>How BoldTreeView works</title>
 <link>http://www.howtodothings.com/computers/a1505-how-boldtreeview-works.html</link>
 <description>&lt;p&gt;This is just a quick set of instructions rather than a comprehensive article.&amp;nbsp; It is a copy of a posting I made in a Borland newsgroup...&lt;/p&gt;
&lt;p&gt; I&#039;ll give you an example of one I did  recently....&lt;/p&gt;
&lt;p&gt; 01) Set the BoldHandle property to your  BoldSystemHandle&lt;br /&gt; 02) Double-click the treeview to bring up the editor&lt;br /&gt; 03)  Click the &amp;quot;Root&amp;quot; element&lt;br /&gt; 04) If it hasn&#039;t already got a child, click &amp;quot;Add  List Fragment&amp;quot;&lt;br /&gt; 05) In ElementExpression enter the main OCL, for  example&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;Customer.allInstances&amp;quot;&lt;br /&gt; 06) Set InterpretAsList to True&lt;br /&gt; 07)  Set ControllerExpression to &#039;Customer&#039; (including quotes)&lt;/p&gt;
&lt;p&gt; What you have  now is a root that grabs a list of Customers.&amp;nbsp; The BTV knows that it needs a  &amp;quot;node controller&amp;quot; called &amp;quot;Customer&amp;quot; to represent each item in the list  (which is why InterpretAsList = True).&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a1505-how-boldtreeview-works.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a1505-how-boldtreeview-works.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Wed, 03 Aug 2005 04:22:00 -0500</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">627 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Store and Retrieve a Bitmap in ECO</title>
 <link>http://www.howtodothings.com/computers/a1501-store-and-retrieve-a-bitmap-in-eco.html</link>
 <description>&lt;p&gt;This article demonstrates the basics of how to store and retrieve a Bitmap in an ECO variable.&lt;/p&gt;
&lt;p&gt; First create an ECO variable in the class you wish to hold the bitmap, for example:&lt;/p&gt;
&lt;p&gt; &lt;strong&gt;FCanvas: Byte&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; Note that we really want a byte array, so right click on FCanvas and select &amp;quot;Go to Definition&amp;quot;.&lt;br /&gt; You can now change the definition to byte[] as follows:&lt;/p&gt;
&lt;p&gt; &lt;strong&gt;private byte[] FCanvas&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; To write the Bitmap to FCanvas use the following:&lt;/p&gt;
&lt;p&gt; &lt;strong&gt;ImageConverter ic = new ImageConverter();&lt;/p&gt;
&lt;p&gt; System.Byte[] ba = (System.Byte[])ic.ConvertTo(bmp, &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; typeof(System.Byte[]));&lt;br /&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt; FCanvas = ba;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; To retrieve the bitmap from FCanvas use the following:&lt;/p&gt;
&lt;p&gt; &lt;strong&gt;System.IO.Stream str = new System.IO.MemoryStream(FCanvas);&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a1501-store-and-retrieve-a-bitmap-in-eco.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a1501-store-and-retrieve-a-bitmap-in-eco.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Sun, 17 Jul 2005 17:15:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">625 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Two functions to evaluate OCL</title>
 <link>http://www.howtodothings.com/computers/a1496-two-functions-to-evaluate-ocl.html</link>
 <description>&lt;p&gt;With the help of Jonas Hogstrom and Jan Nord&amp;eacute;n I have written 2 functions to evaluate OCL.&lt;br /&gt;First is to evaluate OCL in EcoSpace:&lt;br /&gt;&amp;nbsp; public object EvaluateOclInEcoSpace(IElement rootValue, string ocl) &lt;br /&gt;&amp;nbsp; { &lt;br /&gt;&amp;nbsp; &amp;nbsp;object result = null; &lt;br /&gt;&amp;nbsp; &amp;nbsp;IElement e = ((IOclService) &lt;br /&gt;this.GetEcoService(typeof(IOclService))).EvaluateAndSubscrib&amp;shy;e(rootValue, ocl, &lt;br /&gt;null, null); &lt;br /&gt;&amp;nbsp; &amp;nbsp;if (e != null) &lt;br /&gt;&amp;nbsp; &amp;nbsp; result = e.AsObject; &lt;br /&gt;&amp;nbsp; &amp;nbsp;return result; &lt;br /&gt;&amp;nbsp; } Second is to evaluate OCL in PS:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; public object EvaluateOclInDB(IElement rootValue , string ocl) &lt;br /&gt;&amp;nbsp; { &lt;br /&gt;&amp;nbsp; &amp;nbsp;object result = null; &lt;br /&gt;&amp;nbsp; &amp;nbsp;IElement InternalElement = null; &lt;br /&gt;&amp;nbsp; &amp;nbsp;IOclService oclService = (IOclService) &lt;br /&gt;this.GetEcoService(typeof(IOcl&amp;shy;Service));&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a1496-two-functions-to-evaluate-ocl.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a1496-two-functions-to-evaluate-ocl.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Mon, 27 Jun 2005 16:47:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">623 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Dynamic TableStyles Based on Object Type</title>
 <link>http://www.howtodothings.com/computers/a1473-dynamic-tablestyles-based-on-object-type.html</link>
 <description>&lt;p&gt;Here is an example of using different TableStyles depending on the type of the currently selected&amp;nbsp;object in a DataGrid. I have 2 grids, each hooked to ExpressionHandles. I want to display a different set of columns, depending on the type of object in the top grid.&lt;br /&gt;Firstly the application need to know when a new object has been selected. Here a CurrencyManager is being hooked up.&amp;nbsp;dgStock is a DataGrid, ehRoot is an ExpressionHandle containing the Stock objects.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;private &amp;nbsp; cmStock: CurrencyManager;&lt;br /&gt;....&lt;br /&gt;procedure TfrmStock.TfrmStock_Load(sender: System.Object; e: System.EventArgs);&lt;br /&gt;begin&lt;br /&gt;&amp;nbsp; cmStock := CurrencyManager(dgStock.BindingContext[Self.ehRoot]);&lt;br /&gt;&amp;nbsp; Include(cmStock.PositionChanged, Self.StockGridRowChanged);&lt;br /&gt;end;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a1473-dynamic-tablestyles-based-on-object-type.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a1473-dynamic-tablestyles-based-on-object-type.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Thu, 21 Apr 2005 08:15:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">616 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Reading a tagged value</title>
 <link>http://www.howtodothings.com/computers/a1472-reading-a-tagged-value.html</link>
 <description>&lt;p&gt;ECO allows you to add TaggedValues (name/value pair) to your model at design time.&amp;nbsp; Here is how to retrieve the value of a TaggedValue at runtime.&lt;/p&gt;
&lt;p&gt; obj.AsIObject() gives IObject&lt;br /&gt; IObject.UmlType gives an IClassifier&lt;br /&gt; IClassifier is an IModelElement, therefore....&lt;br /&gt; IClassifier.TaggedValues[&#039;hello&#039;] gives ITaggedValue&lt;br /&gt; ITaggedValue.Value gives the string&lt;/p&gt;
&lt;p&gt;ClassDisplayName := &lt;br /&gt; &amp;nbsp; obj.AsIObject().UmlType.TaggedValues[&#039;EcoExtensions.DisplayName&#039;];&lt;/p&gt;
&lt;p&gt; IProperty is also an IElement, so you can get tagged values for properties in exactly the same way.&lt;/p&gt;
&lt;p&gt;obj.AsIObject().Properties[&#039;Name&#039;].UmlType.......&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
</description>
 <comments>http://www.howtodothings.com/computers/a1472-reading-a-tagged-value.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Wed, 20 Apr 2005 23:42:00 -0500</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">615 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>ReEvaluate or ReSubscribe?</title>
 <link>http://www.howtodothings.com/computers/a1467-reevaluate-or-resubscribe.html</link>
 <description>&lt;p&gt;This article will explain derived members in ECO.&amp;nbsp; It&#039;s primary purpose is to describe the difference between the ReEvaluateSubscriber and ReSubscribeSubscriber parameters when you derive members in code.&lt;/p&gt;
&lt;p&gt; One of the excellent features of Bold which have made the transition over into ECO is derived members.&amp;nbsp; A derived member is a bit like a calculated field on a dataset, except it is only calculated the first time you request its value and then that value is cached to processing time.&lt;/p&gt;
&lt;p&gt; Take person&#039;s FullName as an example.&amp;nbsp; Full name would be calculated as&lt;/p&gt;
&lt;p&gt;Result := Title + &#039; &#039; + FirstName + &#039; &#039; + LastName;&lt;/p&gt;
&lt;p&gt; The first important step to creating such an attribute in ECO is to mark the attribute Derived.&amp;nbsp; It is actually possible to specify some &amp;quot;Derivation OCL&amp;quot; and have the ECO system derive everything for you&lt;/p&gt;
&lt;p&gt;title + &#039; &#039; + firstName + &#039; &#039; + lastName&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a1467-reevaluate-or-resubscribe.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a1467-reevaluate-or-resubscribe.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Sat, 09 Apr 2005 10:01:00 -0500</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">610 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>A Multi-Client-ECO application example.</title>
 <link>http://www.howtodothings.com/computers/a1466-a-multi-client-eco-application-example.html</link>
 <description>&lt;p&gt;The application we are going to build can be used for capturing worktime and breaks during the worktime. The worktime can be captured with multiple clients and the server application provides a view of all the data captured.&lt;br /&gt; &lt;strong&gt;[The client part]&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;You start with setting up a winform eco application. This application shall be the client. I named it WorkTimeClient.&lt;br /&gt;You need to have the UML Classes in a package so that you can add them later on to the server application.&lt;br /&gt;&lt;img src=&quot;/MemberData/43c71de27db04617ad26bc4af68b46ec/eco1.png&quot; alt=&quot;New File - ECO UML Package&quot; title=&quot;New File - ECO UML Package&quot; hspace=&quot;0&quot; align=&quot;middle&quot; /&gt;&lt;br /&gt;Create the following model:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/MemberData/43c71de27db04617ad26bc4af68b46ec/eco2.png&quot; alt=&quot;WorkTime Model&quot; title=&quot;WorkTime Model&quot; hspace=&quot;0&quot; align=&quot;middle&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a1466-a-multi-client-eco-application-example.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a1466-a-multi-client-eco-application-example.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Sat, 09 Apr 2005 05:00:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">609 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Turning on/off ECO logging</title>
 <link>http://www.howtodothings.com/computers/a1465-turning-onoff-eco-logging.html</link>
 <description>&lt;p&gt;ECO II has a new feature in Update 2 which makes it easier to see what it is doing behind the scenes.&lt;/p&gt;
&lt;p&gt; When you run your app you can look in the messages window of the Delphi IDE and see what is happening.&amp;nbsp; You can turn on/off switches for different areas of ECO including OCL, PMapper, etc by setting the following options.&lt;/p&gt;
&lt;p&gt; Borland.Eco.&lt;strong&gt;Logging&lt;/strong&gt;.EcoLogSwitches.LogOcl := false/true;&lt;br /&gt; Borland.Eco.&lt;strong&gt;Logging&lt;/strong&gt;.EcoLogSwitches.LogPMapper := false/true;&lt;br /&gt; Borland.Eco.&lt;strong&gt;Logging&lt;/strong&gt;.EcoLogSwitches.LogRegions := false/true;&lt;br /&gt; Borland.Eco.&lt;strong&gt;Logging&lt;/strong&gt;.EcoLogSwitches.LogSql := false/true;&lt;br /&gt; Borland.Eco.&lt;strong&gt;Logging&lt;/strong&gt;.EcoLogSwitches.LogSqlMeta := false/true;&lt;br /&gt; Borland.Eco.&lt;strong&gt;Logging&lt;/strong&gt;.EcoLogSwitches.LogValidation := false/true; &lt;/p&gt;
</description>
 <comments>http://www.howtodothings.com/computers/a1465-turning-onoff-eco-logging.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Thu, 07 Apr 2005 03:23:00 -0500</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">608 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Automatically setting the MaxLength in your GUI</title>
 <link>http://www.howtodothings.com/computers/a1462-automatically-setting-the-maxlength-in-your-gui.html</link>
 <description>&lt;p&gt;As of D2005 udpate #2 there is a new helper class in the ECO framework named MaxLengthSupportFunctions.&lt;/p&gt;
&lt;p&gt; Normally when you databind an EditBox for example to an ECO object you are able to type endlessly despite the fact that you may have set the Eco.Length of the attribute to something small like 32.&lt;/p&gt;
&lt;p&gt; This new helper class will identify such situations and automatically set the MaxLength property.&amp;nbsp; All you have to do is to execute the following line of code after your rhRoot has been set.&lt;/p&gt;
&lt;p&gt;Borland.Eco.WinForm.MaxLengthSupportFunctions.UpdateMaxLengths(Controls);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
</description>
 <comments>http://www.howtodothings.com/computers/a1462-automatically-setting-the-maxlength-in-your-gui.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Tue, 15 Mar 2005 08:14:00 -0600</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">605 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Disabling multiplicity constraints</title>
 <link>http://www.howtodothings.com/computers/a1461-disabling-multiplicity-constraints.html</link>
 <description>&lt;p&gt;If you have ever tried reading constraints from an ECO model you have probably noticed by now that there are lots of auto-generated multiplicity constraints.&lt;/p&gt;
&lt;p&gt; I personally like to add my own constraints for multiplicity so that I can specify a more concise error message&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; Customer required:customer &amp;lt;&amp;gt; nil&lt;/p&gt;
&lt;p&gt; To disable multiplicity constraints you need to attach a .net attribute to your EcoSpace like so&lt;/p&gt;
&lt;p&gt;[UmlTaggedValue(&amp;quot;Eco.GenerateMultiplicityConstraints&amp;quot;, &amp;quot;False&amp;quot;)]&lt;br /&gt; public class ProjectManagerEcoSpace: Borland.Eco.Handles.DefaultEcoSpace&lt;/p&gt;
</description>
 <comments>http://www.howtodothings.com/computers/a1461-disabling-multiplicity-constraints.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Tue, 15 Mar 2005 05:37:00 -0600</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">604 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Evaluating constraints</title>
 <link>http://www.howtodothings.com/computers/a1440-evaluating-constraints.html</link>
 <description>&lt;p&gt;Before updating the database with changes to your objects it is wise to check that the object is in a valid state first.&amp;nbsp; ECO allows you to model constraints against your classes by adding a list of OCL expressions, but does not evaluate the expressions at any point.&lt;/p&gt;
&lt;p&gt;It is in fact the responsibility of the application to check whether or not an object is valid or invalid, and to then decide what to do about it.&amp;nbsp; One approach is to check the validity of each object before it is saved, this can be achieved in the UpdateDatabase() method of your EcoSpace.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a1440-evaluating-constraints.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a1440-evaluating-constraints.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Sat, 26 Feb 2005 04:21:00 -0600</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">586 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Sending HTML emails with ICS</title>
 <link>http://www.howtodothings.com/computers/a1427-sending-html-emails-with-ics.html</link>
 <description>&lt;p&gt;procedure THtmlMailForm.SendButtonClick(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt;	if FRunning then begin&lt;br /&gt;		MessageBeep(MB_OK);&lt;br /&gt;		Display(&#039;**** ALREADY RUNNING ****&#039;);&lt;br /&gt;		Exit;&lt;br /&gt;	end;&lt;/p&gt;
&lt;p&gt;	FRunning := TRUE;&lt;br /&gt;	try&lt;br /&gt;		{ Give the component the various data he need }&lt;br /&gt;		HtmlSmtpClient.PlainText := PlainTextMemo.Lines;&lt;br /&gt;		HtmlSmtpClient.HtmlText := HtmlTextMemo.Lines;&lt;br /&gt;		HtmlSmtpClient.EmailImages := ImageFilesMemo.Lines;&lt;br /&gt;		HtmlSmtpClient.EmailFiles := AttachedFilesMemo.Lines;&lt;/p&gt;
&lt;p&gt;		{ Initialize all SMTP component properties from our GUI }&lt;br /&gt;		HtmlSmtpClient.Host := HostEdit.Text;&lt;br /&gt;		HtmlSmtpClient.Port := PortEdit.Text;&lt;br /&gt;		HtmlSmtpClient.SignOn := SignOnEdit.Text;&lt;br /&gt;		HtmlSmtpClient.FromName := FromEdit.Text;&lt;br /&gt;		HtmlSmtpClient.HdrFrom := FromEdit.Text;&lt;br /&gt;		HtmlSmtpClient.HdrTo := ToEdit.Text;&lt;br /&gt;		HtmlSmtpClient.HdrCc := CcEdit.Text;&lt;br /&gt;		HtmlSmtpClient.HdrSubject := SubjectEdit.Text;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a1427-sending-html-emails-with-ics.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a1427-sending-html-emails-with-ics.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Thu, 10 Feb 2005 10:09:00 -0600</pubDate>
 <dc:creator />
 <guid isPermaLink="false">583 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Evaluating in-database OCL in code</title>
 <link>http://www.howtodothings.com/computers/a1425-evaluating-in-database-ocl-in-code.html</link>
 <description>&lt;p&gt;In a form etc we can evaluate OCL in the DB by using an OclPSHandle, but how do you evaluate OCL in the DB in code?&lt;/p&gt;
&lt;p&gt; This tip thanks to Jan Norden from Borland.&lt;br /&gt; IOclService oclService = &lt;br /&gt;  (IOclService) GetEcoService(typeof(IOclService));&lt;br /&gt;IPersistenceService  persistenceService = &lt;br /&gt;  (IPersistence) GetEcoService(typeof(IPersistenceService));&lt;/p&gt;
&lt;p&gt;AbstractCondition cond = &lt;br /&gt;  OclService.CreateRetrieveCondition(RootValue, EffectiveVariables(), Expression);&lt;/p&gt;
&lt;p&gt;InternalElement = persistenceService.GetAllWithCondition(cond, MaxAnswers, Offset);&lt;/p&gt;
</description>
 <comments>http://www.howtodothings.com/computers/a1425-evaluating-in-database-ocl-in-code.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Thu, 10 Feb 2005 04:42:00 -0600</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">582 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Code derived associations</title>
 <link>http://www.howtodothings.com/computers/a1421-code-derived-associations.html</link>
 <description>&lt;p&gt;This article will demonstrate how to use code derived associations to implement user-defined class constraints.&lt;/p&gt;
&lt;p&gt;Code derived association is derived association without provided Derived OCL expression - the logic must be implemented in your code.&lt;/p&gt;
&lt;p&gt;Please read &lt;a href=&quot;http://blogs.borland.com/malcolmgroves&quot; target=&quot;_blank&quot;&gt;Malcolm Groves&#039; articles&lt;/a&gt; if you are not sure what derived association is.&lt;/p&gt;
&lt;p&gt;These two articles are the most relevant to the subject:&lt;br /&gt;ECO : &lt;a href=&quot;http://blogs.borland.com/malcolmgroves/archive/2004/06/24/604.aspx&quot; target=&quot;_blank&quot;&gt;Derived Associations&lt;/a&gt;&lt;br /&gt;ECO : &lt;a href=&quot;http://blogs.borland.com/malcolmgroves/archive/2004/06/22/577.aspx&quot; target=&quot;_blank&quot;&gt;Derived Attributes Part 2 - Code Derived Attributes&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Problem:&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;Often users ask us if we can make one or another field of our system mandatory.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a1421-code-derived-associations.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a1421-code-derived-associations.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Tue, 01 Feb 2005 13:09:00 -0600</pubDate>
 <dc:creator />
 <guid isPermaLink="false">580 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>D4: Making TCheckbox Data Aware with TDBEdit</title>
 <link>http://www.howtodothings.com/computers/a762-d4-making-tcheckbox-data-aware-with-tdbedit.html</link>
 <description>&lt;p&gt;Simple means of making some components data-aware. Alternative data-aware checkboxes (and radiobuttons) that can be arranged more flexibly.&lt;br&gt;&lt;br&gt;
&lt;p&gt;Although more recent versions of Delphi may offer better ways of displaying data-aware collections of checkboxes and radiobuttons, I&#039;m still using D4. I have often wished for a data-aware component that (a) does not include the bevelled box of  D4&#039;s radio button group, (b) can be made to resemble some paper forms more closely, (c) permits more flexible arrangement of the items in the group, and (d) permits unusual patterns of buttons to be &#039;on&#039; and &#039;off&#039; simultaneously.&lt;/p&gt;
&lt;p&gt;In short, more flexibility.&lt;/p&gt;
&lt;p&gt;I think this recipe does this, and it also illustrates simple means for making some controls that are not data-aware acquire this capability by co-operating with those that are.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;delphi.jpg&quot; src=&quot;http://www.howtodothings.com/MemberData/ddaad4ce6d304f98b73bc6556a02c1a3/delphi.jpg&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a762-d4-making-tcheckbox-data-aware-with-tdbedit.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a762-d4-making-tcheckbox-data-aware-with-tdbedit.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Mon, 03 Jan 2005 23:00:00 -0600</pubDate>
 <dc:creator />
 <guid isPermaLink="false">60 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>ECO2 Expression Handles and the ASP.NET Repeater Control</title>
 <link>http://www.howtodothings.com/computers/a795-eco2-expression-handles-and-the-aspnet-repeater-control.html</link>
 <description>&lt;p&gt;How do we databind the information from the ExpressionHandle or other handle type into the ASP.NET Repeater control?  Took a little double take viewing, but Pete Morris kindly helped overcome the issue.&lt;br&gt;&lt;br&gt;
&lt;p&gt;The natural urge from most Delphi Devs is to relate things to the DataSource. Understandable, as our time with Delphi has taught us a lot in that area.&lt;/p&gt;
&lt;p&gt;I initially went wrong because I would refer to the Handle list component as the source part for the &lt;strong&gt;DataBinder.Eval&lt;/strong&gt; call, as such (PS this is incorrect and will fail):&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;DataBinder.Eval&lt;/strong&gt;(&lt;strong&gt;ehLogins&lt;/strong&gt;, &amp;quot;&lt;strong&gt;MyPropertyOrFieldName&lt;/strong&gt;&amp;quot;)&lt;/p&gt;
&lt;p&gt;There is a short process to go through to get the repeater control to correctly display the data we want.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a795-eco2-expression-handles-and-the-aspnet-repeater-control.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a795-eco2-expression-handles-and-the-aspnet-repeater-control.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Mon, 03 Jan 2005 23:00:00 -0600</pubDate>
 <dc:creator>Scott4</dc:creator>
 <guid isPermaLink="false">75 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Composition is much better than inheritance</title>
 <link>http://www.howtodothings.com/computers/a777-composition-is-much-better-than-inheritance.html</link>
 <description>&lt;p&gt;This article explains the pitfalls of inheritance, and offers a solution...&lt;/p&gt;
&lt;p&gt;In this article I will have to use some ficticious class names etc due to the sensitivity of the project I am working on, so bear with me if some of the information seems&amp;nbsp;a bit strange.&lt;/p&gt;
&lt;p&gt;After working myself about 6 levels deep in inheritance I suddenly realised that my Factory class&amp;nbsp;had a DateOfBirth.&amp;nbsp; This was certainly undesirable, but with my current model I couldn&#039;t do anything about it.&amp;nbsp; My options were to get rid of the inheritance for Factory and lose all of the benefits of doing that (having &amp;quot;AdditionalInformation&amp;quot; definable by the user for example), or to ignore the DateOfBirth and not show it in the GUI.&lt;/p&gt;
&lt;p&gt;Both of these options were rubbish.&amp;nbsp; Instead of taking either of them, I went for a completely different option instead.&amp;nbsp; I decided to remove almost all inheritance within my model, and add composite relationships instead.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a777-composition-is-much-better-than-inheritance.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a777-composition-is-much-better-than-inheritance.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Fri, 10 Dec 2004 23:00:00 -0600</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">63 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Composition and recursive OCL</title>
 <link>http://www.howtodothings.com/computers/a776-composition-and-recursive-ocl.html</link>
 <description>&lt;p&gt;This article demonstrates a simple example of using recusive OCL within a composite pattern.&lt;/p&gt;
&lt;p&gt;&amp;quot;To understand recursion we must first understand recursion&amp;quot; [Source unknown]&lt;/p&gt;
&lt;p&gt;Surely there isn&#039;t a professional programmer out there who hasn&#039;t used recursion? I&#039;d bet that the first recursive routine that most of those programmers wrote was some kind of FindAllFiles routine. The beauty of recursion is that it is so simple, yet the results give the illusion that the code must be far more complicated.&lt;/p&gt;
&lt;p&gt;I&#039;m slowly rewriting &lt;a href=&quot;../&quot;&gt;www.HowToDoThings.com&lt;/a&gt; in my very little spare time. Before the categorisation of articles was three levels deep, no more and no less; Topic-&amp;gt;Category-&amp;gt;SubCategory. One of the improvements I have decided to add to the site is the ability to nest an unlimited amount of levels. To do this I implemented a pretty basic OOP composite pattern like so&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a776-composition-and-recursive-ocl.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a776-composition-and-recursive-ocl.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Thu, 09 Dec 2004 23:00:00 -0600</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">62 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Code Derived Columns in ECO II</title>
 <link>http://www.howtodothings.com/computers/a781-code-derived-columns-in-eco-ii.html</link>
 <description>&lt;p&gt;Explains what Code Derived Columns are, and how to use them.&lt;/p&gt;
&lt;p&gt;The focus of this article will be &amp;quot;Event derived columns&amp;quot;.&amp;nbsp; Jan Nord&amp;eacute;n (Borland) pointed me in the direction of these things recently when I asked him how to solve a GUI problem I had.&amp;nbsp; When I used Bold for Delphi there was this really nice GUI component called a BoldSelectionListBox.&amp;nbsp; This component would let me show a list of items with a CheckBox next to each row, ticking / unticking a box would add / remove an association item between the item&amp;nbsp;selected and some other object of my choice.&amp;nbsp; That&#039;s not the best explanation in the World, so take a look at the following UML diagram:&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;../MemberData/0c09d31ef1f24b40bba2159a016676e9/NtoMLarge.jpg&quot;&gt;&lt;img border=&quot;0&quot; alt=&quot;Click to enlarge&quot; src=&quot;../MemberData/0c09d31ef1f24b40bba2159a016676e9/NtoMSmall.jpg&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a781-code-derived-columns-in-eco-ii.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a781-code-derived-columns-in-eco-ii.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Fri, 03 Dec 2004 23:00:00 -0600</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">64 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Tidy Component Library for Easy Migrations or Builds</title>
 <link>http://www.howtodothings.com/computers/a764-tidy-component-library-for-easy-migrations-or-builds.html</link>
 <description>&lt;p&gt;Controlling your Library Path can be benefitial for a number of reasons, easy reading, sharing network components/libraries, or even for escrowing projects.&lt;br&gt;&lt;br&gt;
&lt;p&gt;There is a relatively way to control the many component libraries we have available for our use in Delphi.&lt;/p&gt;
&lt;p&gt;An example of its syntax can be seen at the top of the Delphi Library Path dialog, as seen below:&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img alt=&quot;tidy_comps_delphi_library_paths.gif&quot; src=&quot;http://www.howtodothings.com/MemberData/55001342925541119be145ebc02f62dd/tidy_comps_delphi_library_paths.gif&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This &lt;strong&gt;$(DELPHI)&lt;/strong&gt; syntax is easily replicated for our own use. For example, I try to keep my components very tightly version controlled, and all in one directory. My reason for this approach is a nasty past experience of building an escrow for a customer was a painful task to build, test, and maintain.&lt;/p&gt;
&lt;p&gt;However, this neat-freak approach helps us build an easily maintained approach to the Library entries.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a764-tidy-component-library-for-easy-migrations-or-builds.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a764-tidy-component-library-for-easy-migrations-or-builds.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Mon, 15 Nov 2004 23:00:00 -0600</pubDate>
 <dc:creator>Scott4</dc:creator>
 <guid isPermaLink="false">61 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Windows Search Engine</title>
 <link>http://www.howtodothings.com/computers/a782-windows-search-engine.html</link>
 <description>&lt;p&gt;Implementing Shell Search Handler using Delphi&lt;br&gt;&lt;br&gt;
&lt;p&gt;&lt;font size=&quot;1&quot;&gt;The Shell supports several search utilities that allow users to locate namespace objects such as files or printers. You can create a custom search engine and make it available to users by implementing and registering a search handler. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;1&quot;&gt;Users have two ways to select a search engine. The first way is from the Start menu. With systems earlier than Microsoft Windows 2000, selecting the Find command on the Start menu displays a submenu of the available search engines. With Windows 2000 and later, the Start menu&#039;s Find command is renamed Search.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a782-windows-search-engine.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a782-windows-search-engine.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Sun, 07 Nov 2004 23:00:00 -0600</pubDate>
 <dc:creator />
 <guid isPermaLink="false">65 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>How to store the contents of a RichEdit in an EMF files</title>
 <link>http://www.howtodothings.com/computers/a799-how-to-store-the-contents-of-a-richedit-in-an-emf-files.html</link>
 <description>&lt;p&gt;Howto store the contents of a RichEdit in an EMF files&lt;/p&gt;
&lt;p&gt;Sometimes, you may want to store the contents of a rich edit control in a metafile. This article outlines an approach that stores this type of control&#039;s contents in enhanced metafiles, one page per metafile. The following code demonstrates one method to dump the contents of a rich edit control into EMF files (one per page):&lt;/p&gt;
&lt;p&gt;unit RichEditEMFPrint;&lt;/p&gt;
&lt;p&gt; interface&lt;/p&gt;
&lt;p&gt; uses&lt;br /&gt; &amp;nbsp; Windows, SysUtils, RichEdit, commdlg, classes, messages, Comctrls;&lt;/p&gt;
&lt;p&gt; procedure RichEditToMetaFile(AControl : TRichEdit; AFileName : string);&lt;/p&gt;
&lt;p&gt; implementation&lt;/p&gt;
&lt;p&gt; // GetPrinterDC()&lt;br /&gt; // returns a printer DC - uses Printer Common Dialog&lt;br /&gt; function GetPrinterDC : HDC;&lt;br /&gt; var&lt;br /&gt; &amp;nbsp; pdlg : TPRINTDLG;&lt;br /&gt; begin&lt;br /&gt; &amp;nbsp; FillChar(pdlg, sizeof(TPRINTDLG), 0);&lt;br /&gt; &amp;nbsp; pdlg.lStructSize := sizeof( TPRINTDLG );&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a799-how-to-store-the-contents-of-a-richedit-in-an-emf-files.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a799-how-to-store-the-contents-of-a-richedit-in-an-emf-files.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Tue, 14 Sep 2004 23:00:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">76 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Changing Left and Right channel volumes separately:</title>
 <link>http://www.howtodothings.com/computers/a786-changing-left-and-right-channel-volumes-separately.html</link>
 <description>&lt;p&gt;This article describes a simple way to set left and right channel volumes separately.&lt;br&gt;&lt;br&gt;
&lt;p&gt;Changing Left and Right channel volumes separately:&lt;/p&gt;
&lt;p&gt;By : Pooia Lalbakhsh&lt;br /&gt;MS in Computer Engineering&lt;/p&gt;
&lt;p&gt;These two procedures illustrated bellow set the  volumes &lt;br /&gt;of right and left channels separately.&lt;/p&gt;
&lt;p&gt;Using Waveoutsetvolume from MMsystem you can set the wave out volme.&lt;br /&gt;to do this you have to set the value into a Dword variable:&lt;/p&gt;
&lt;p&gt;The 2 low order bytes : volume for the left channel which can be something &lt;br /&gt;between 0 upto 65535&lt;/p&gt;
&lt;p&gt;The 2 high order bytes : volume for the right channel which can be sonething&lt;br /&gt;between 0 upto 65535&lt;/p&gt;
&lt;p&gt;using these procedures you can set the channels separately:&lt;/p&gt;
&lt;p&gt;uses MMsystem&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a786-changing-left-and-right-channel-volumes-separately.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a786-changing-left-and-right-channel-volumes-separately.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Mon, 23 Aug 2004 23:00:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">68 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Sending HTML emails with Indy</title>
 <link>http://www.howtodothings.com/computers/a791-sending-html-emails-with-indy.html</link>
 <description>&lt;p&gt;This example shows how to send HTML emails using Delphi and Indy, with embedded images.&lt;br&gt;&lt;br&gt;
&lt;p&gt;&lt;u&gt;&lt;font color=&quot;#0000ff&quot;&gt;uses&lt;br /&gt;  idMessage;&lt;br&gt;&lt;br&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br /&gt;var&lt;br /&gt;  html: TStrings;&lt;br /&gt;  htmpart, txtpart: TIdText;&lt;br /&gt;  bmppart: TIdAttachment;&lt;br /&gt;  email: TIdMessage;&lt;br /&gt;  filename: string;&lt;br /&gt;begin&lt;br /&gt;  filename := ExtractFilePath(Application.ExeName) + &#039;us.jpg&#039;;&lt;br&gt;&lt;br&gt;  html := TStringList.Create();&lt;br /&gt;  html.Add(&#039;&amp;lt;html&amp;gt;&#039;);&lt;br /&gt;  html.Add(&#039;&amp;lt;head&amp;gt;&#039;);&lt;br /&gt;  html.Add(&#039;&amp;lt;/head&amp;gt;&#039;);&lt;br /&gt;  html.Add(&#039;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;Hello&amp;lt;/h1&amp;gt;&#039;);&lt;br /&gt;  html.Add(&#039;&amp;lt;img src=&amp;quot;cid:us.jpg&amp;quot; /&amp;gt;&#039;);&lt;br /&gt;  html.Add(&#039;This is a picture of us!&amp;lt;/body&amp;gt;&#039;);&lt;br /&gt;  html.Add(&#039;&amp;lt;/html&amp;gt;&#039;);&lt;br&gt;&lt;br&gt;  email := TIdMessage.Create(nil);&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a791-sending-html-emails-with-indy.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a791-sending-html-emails-with-indy.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Tue, 10 Aug 2004 23:00:00 -0500</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">73 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Password Authentication</title>
 <link>http://www.howtodothings.com/computers/a849-password-authentication.html</link>
 <description>&lt;p&gt;Password authentication is used in many systems for authenticating the identity of one or both peers of a connection. This paper will help you design more secure password authentication schemes using symmetric cryptographic techniques.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
	&lt;br&gt;&lt;br /&gt;
	Password Authentication using Symmetric Techniques&lt;br&gt;&lt;br /&gt;
	&lt;br&gt;&lt;br /&gt;
	&lt;br&gt;&lt;br /&gt;
	&lt;br&gt;&lt;br /&gt;
	&lt;br&gt;&lt;br /&gt;
	&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
	&lt;br&gt;&lt;/p&gt;
&lt;p&gt;		@page { size: 21cm 29.7cm; margin: 2cm }&lt;br&gt;&lt;br /&gt;
		P { margin-bottom: 0.21cm }&lt;br&gt;&lt;br /&gt;
		H1 { margin-bottom: 0.21cm }&lt;br&gt;&lt;br /&gt;
		H1.western { font-family: &quot;Arial&quot;, sans-serif; font-size: 16pt }&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a849-password-authentication.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a849-password-authentication.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Fri, 09 Jul 2004 23:00:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">111 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Fast Refactoring with Castalia</title>
 <link>http://www.howtodothings.com/computers/a837-fast-refactoring-with-castalia.html</link>
 <description>&lt;p&gt;Refactoring is the process of &amp;quot;improving the design of existing code.&amp;quot;  Learn how to become a faster and more productive refactorer with Castalia.&lt;/p&gt;
&lt;p&gt;This is the fourth and last installment of my series of articles discussing the results of our study into how Castalia helps developers become more productive.  Over the last month, I&amp;#39;ve written about reducing work by reducing keystrokes, writing quality code faster with live error checking, and navigating through code faster and more accurately.  This week, I will discuss one of Castalia&amp;#39;s most productive and most useful features: Automated Refactoring.&lt;/p&gt;
&lt;p&gt; 
&lt;p&gt;It doesn&amp;#39;t matter how good we are, we all write code that could be better.  We often look at existing code and realize we could have used better class names, better separation of methods, better organization, etc....  This is what refactoring is about - changing existing code for the better.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a837-fast-refactoring-with-castalia.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a837-fast-refactoring-with-castalia.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Thu, 20 May 2004 23:00:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">100 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>COM and Windows Services</title>
 <link>http://www.howtodothings.com/computers/a818-com-and-windows-services.html</link>
 <description>&lt;p&gt;A little tip on using COM with Windows Services.&lt;br&gt;&lt;br&gt;
&lt;p&gt;Today I tried accessing an XML document from a Windows service.  When I prototyped my classes using a Windows forms app everything worked fine, but when I used the same classes in a Windows service I kept getting the error &amp;quot;CoInitialize has not been called&amp;quot;.&lt;/p&gt;
&lt;p&gt;CoInitialize must be called for every thread when using any kind of COM object.  The catch is that the TService class which comes with Delphi creates its own support thread in order to execute the OnExecute event.  Once you know this, is it quite simple to rectify your code&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;procedure TMyService.ServiceExecute(Sender: TService);&lt;/p&gt;
&lt;p&gt;begin&lt;/p&gt;
&lt;p&gt;  CoInitialize(nil);&lt;/p&gt;
&lt;p&gt;  try&lt;/p&gt;
&lt;p&gt;    //Your code here&lt;/p&gt;
&lt;p&gt;  finally&lt;/p&gt;
&lt;p&gt;    CoUnInitialize;&lt;/p&gt;
&lt;p&gt;  end;&lt;/p&gt;
&lt;p&gt;end;&lt;/p&gt;
&lt;/p&gt;
</description>
 <comments>http://www.howtodothings.com/computers/a818-com-and-windows-services.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Wed, 19 May 2004 23:00:00 -0500</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">85 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>How to reduce time spent finding errors</title>
 <link>http://www.howtodothings.com/computers/a882-how-to-reduce-time-spent-finding-errors.html</link>
 <description>&lt;p&gt;Learn about the various error finding habits of Delphi developers and how you can overcome bad habits to find errors faster and more efficiently&lt;br&gt;&lt;br&gt;
&lt;p&gt;(Originally published at delphi-expert.com on May 1, 2004)&lt;/p&gt;
&lt;p&gt; &lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What&#039;s new?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;We just released Castalia 2.3, which includes support for the new Delphi 8 for the Microsoft .NET platform!&amp;nbsp; Details are &lt;a href=&quot;http://www.delphi-expert.com/castalia2/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Spend less time finding errors&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;In the course of our &lt;a href=&quot;http://www.delphi-expert.com/4fold&quot;&gt;research&lt;/a&gt;, we discovered two common patterns among developers in the way they find syntax errors. Developers who do not use Castalia tend to fall into one of two groups:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a882-how-to-reduce-time-spent-finding-errors.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a882-how-to-reduce-time-spent-finding-errors.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Thu, 13 May 2004 23:00:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">134 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>How to reduce development time by reducing keystrokes</title>
 <link>http://www.howtodothings.com/computers/a809-how-to-reduce-development-time-by-reducing-keystrokes.html</link>
 <description>&lt;p&gt;This article discusses observations on how the most effective developers are able to cut the amount of typing they do nearly in half and gives recommendations on how you can experience the same boost in productivity.&lt;br&gt;&lt;br&gt;
&lt;p&gt;(Originally published at delphi-expert.com on April 20, 2004)&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a809-how-to-reduce-development-time-by-reducing-keystrokes.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a809-how-to-reduce-development-time-by-reducing-keystrokes.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Thu, 13 May 2004 23:00:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">82 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>How to navigate through your code faster</title>
 <link>http://www.howtodothings.com/computers/a822-how-to-navigate-through-your-code-faster.html</link>
 <description>&lt;p&gt;This article teaches techniques developers can use to navigate code faster and comprehend it better.&lt;br&gt;&lt;br&gt;
&lt;p&gt;(Originally published at delphi-expert.com on May 14, 2004)&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;This is the third in our 4-part series outlining the results of our study into how Castalia helps developers become more productive.&amp;nbsp; Previously, we reported on &lt;a href=&quot;http://www.delphi-expert.com/articles/study_keystrokes.html&quot;&gt;reducing work by reducing keystrokes&lt;/a&gt; and&amp;nbsp;&lt;a href=&quot;http://www.delphi-expert.com/articles/study_errors.html&quot;&gt;writing quality code faster with live error checking&lt;/a&gt;.&amp;nbsp; This week we&#039;ll discuss code navigation, developer habits, and how Castalia helped our test subjects navigate their code better.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a822-how-to-navigate-through-your-code-faster.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a822-how-to-navigate-through-your-code-faster.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Thu, 13 May 2004 23:00:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">88 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Using try..except to handle errors</title>
 <link>http://www.howtodothings.com/computers/a826-using-tryexcept-to-handle-errors.html</link>
 <description>&lt;p&gt;Learn about exceptions and how to write better error handling code. Learn how Castalia can help us write more robust and fault tolerant code.&lt;br&gt;&lt;br&gt;
&lt;p&gt;(Originally published at delphi-expert.com on March 23, 2004)&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;As promised, today is part two of our discussion of Delphi&#039;s &lt;strong&gt;try&lt;/strong&gt; constructs. Last week, we looked at &lt;strong&gt;try..finally&lt;/strong&gt;, learned what it is intended for, when to use it, and how Castalia can help us use it more effectively. This week, we will examine the other half of the &lt;strong&gt;try&lt;/strong&gt; family, &lt;strong&gt;try..except&lt;/strong&gt; and learn how Castalia can make our &lt;strong&gt;try..except&lt;/strong&gt; usage more effective. We will also make fun of java.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a826-using-tryexcept-to-handle-errors.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a826-using-tryexcept-to-handle-errors.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Thu, 13 May 2004 23:00:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">91 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>How to automatically split temporary variables in Delphi</title>
 <link>http://www.howtodothings.com/computers/a850-how-to-automatically-split-temporary-variables-in-delphi.html</link>
 <description>&lt;p&gt;This article discusses proper usage of temporary variables, motivations for splitting improper variables, and how to use Castalia to automatically split them.&lt;br&gt;&lt;br&gt;
&lt;p&gt;I would like to address a question that I get frequently from people who are seeing &lt;a href=&quot;http://www.delphi-expert.com&quot;&gt;Castalia&lt;/a&gt; for the first time.&amp;nbsp; When they look at the refactorings, they see things like &quot;Extract Method&quot; and &quot;Rename Local Variable,&quot; which are pretty self-explanatory.&amp;nbsp; That is, you can figure out what they do based on the name.&amp;nbsp; Then they see &quot;Split Temporary Variable&quot; and they&#039;re not sure what to think.&amp;nbsp; It&#039;s not a very intuitive refactoring, and for the most part, it gets ignored, despite being incredibly useful.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a850-how-to-automatically-split-temporary-variables-in-delphi.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a850-how-to-automatically-split-temporary-variables-in-delphi.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Thu, 13 May 2004 23:00:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">112 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Using try...finally to avoid resource leaks</title>
 <link>http://www.howtodothings.com/computers/a825-using-tryfinally-to-avoid-resource-leaks.html</link>
 <description>&lt;p&gt;This article discusses Delphi&#039;s try..finally construct, when to use, and how Castalia makes it easier to use.&lt;br&gt;&lt;br&gt;
&lt;p&gt;(Originally published at delphi-expert.com on March 16, 2004)&lt;/p&gt;
&lt;p&gt;In a line of business that has me examining a lot of source code, I sometimes notice common habits and trends in people&#039;s code. Sometimes these habits are good, like using assertions. Sometimes the habits are bad, like using labels and gotos. Sometimes, the code is simply missing some very important elements, either due to laziness or inadequate understanding on the part of the programmer who wrote the code. One of these constructs that is very powerful, but often neglected and sometimes misused, is Delphi&#039;s &amp;quot;try&amp;quot; construct. Over the next two weeks, we&#039;re going to look at what these constructs do and how to use them well, and how Castalia can help you use them effectively and not neglect them.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a825-using-tryfinally-to-avoid-resource-leaks.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a825-using-tryfinally-to-avoid-resource-leaks.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Thu, 13 May 2004 23:00:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">90 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Tutorial: Write your own FindFiles tool</title>
 <link>http://www.howtodothings.com/computers/a868-tutorial-write-your-own-findfiles-tool.html</link>
 <description>&lt;p&gt;How to use FindFirst and FindNext with recursion, for adding filenames and paths to a stringlist&lt;br&gt;&lt;br&gt;
&lt;p&gt;&lt;font size=&quot;2&quot;&gt;&lt;strong&gt;How to create a list of the files in a folder and its subfolders&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;2&quot;&gt;In the following short tutorial, I&#039;ll show you the basics for writing your own &amp;quot;Find Files&amp;quot; tool.&lt;br /&gt; &lt;br /&gt;The procedure &lt;strong&gt;FindFiles&lt;/strong&gt;(&lt;em&gt;FilesList&lt;/em&gt;, &lt;em&gt;StartDir&lt;/em&gt;, &lt;em&gt;FileMask&lt;/em&gt;) locates files in a given folder and its subfolders. The files correspond to a filemask that you specify. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;2&quot;&gt;Parameter &lt;em&gt;FilesList&lt;/em&gt; is a stringlist to which the full paths of the files will be added.&lt;br /&gt; &lt;br /&gt;In parameter &lt;em&gt;StartDir&lt;/em&gt; you pass the starting directory (folder), including the disk drive. If you want to search an entire disk, you specify the root directory of that disk, such as C:\ or A:\&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a868-tutorial-write-your-own-findfiles-tool.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a868-tutorial-write-your-own-findfiles-tool.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Tue, 11 May 2004 23:00:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">127 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Role based programming in Bold</title>
 <link>http://www.howtodothings.com/computers/a866-role-based-programming-in-bold.html</link>
 <description>&lt;p&gt;An example of implementing the Actor/Role pattern in Bold.&lt;br&gt;&lt;br&gt;&lt;br /&gt;
&lt;p align=&quot;center&quot;&gt;&lt;strong&gt;&lt;u&gt;Role based programming in Bold&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p align=&quot;left&quot;&gt;Bold allows developers to develop OOP applications which persist to a database. This gives us the ability to add inheritance to our applications, but this ability can be over used.&lt;/p&gt;
&lt;p align=&quot;left&quot;&gt;As an example, in an application I developed in Bold once I had the following model&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img alt=&quot;UMLInheritance.jpg&quot; src=&quot;http://www.howtodothings.com/MemberData/0c09d31ef1f24b40bba2159a016676e9/UMLInheritance.jpg&quot; /&gt;&lt;/p&gt;
&lt;p align=&quot;left&quot;&gt;The above structure allows the application to record purchase orders against a Customer, admin work can be assigned to an AdminEmployee, and flight information can be recorded against a Pilot.&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;strong&gt;&lt;u&gt;Role based&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a866-role-based-programming-in-bold.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a866-role-based-programming-in-bold.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Mon, 03 May 2004 23:00:00 -0500</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">125 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>How to make a TEdit numeric</title>
 <link>http://www.howtodothings.com/computers/a855-how-to-make-a-tedit-numeric.html</link>
 <description>&lt;p&gt;A small tip showing how to tell windows that your Edit control should only allow numeric entry.&lt;br&gt;&lt;br&gt;
&lt;p&gt;If you need a Windows Edit control to only accept valid numbers, but don&#039;t want to use TSpinEdit, here is a simple piece of code which will allow you to alter the behaviour of a standard Windows Edit control.&lt;/p&gt;
&lt;p&gt;procedure MakeNumericOnly(Handle: THandle);&lt;br /&gt;begin&lt;br /&gt;  SetWindowLong(Handle, GWL_STYLE, &lt;br /&gt;    GetWindowLong(Handle, GWL_STYLE) or ES_NUMBER);&lt;br /&gt;end;&lt;/p&gt;
</description>
 <comments>http://www.howtodothings.com/computers/a855-how-to-make-a-tedit-numeric.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Tue, 27 Apr 2004 23:00:00 -0500</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">117 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>How to detect if diskdrive contains a floppy</title>
 <link>http://www.howtodothings.com/computers/a806-how-to-detect-if-diskdrive-contains-a-floppy.html</link>
 <description>&lt;p&gt;This article explains how to detect if a diskette is in the disk drive on NT based systems (w2k, XP)&lt;br&gt;&lt;br&gt;Windows has the habit of requesting the user to insert a floppy. Normally this would not be a problem, but suppose you want to know if a floppy is in the drive or not.&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
There are various ways to detect a floppy disk, an easy method is the function DirectoryExists which is declared in filectrl.pas.&lt;br&gt;&lt;br /&gt;
If a floppy is there, it succeeds. If not, the function will only fail after the user has pressed &#039;Cancel&#039; to the question wether he/she wants to insert a floppy disk.&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
This behaviour can be altered by (temporary) setting the windows error behaviour when calling an api. By setting this to &#039;critical only&#039;, we effectively prevent windows from querying the user.&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
Here is an example function that checks if a floppy is in drive A.&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
&lt;code&gt;&lt;br&gt;&lt;br /&gt;
uses filectrl;&lt;br&gt;&lt;br /&gt;
//..//&lt;br&gt;&lt;br /&gt;
function IsFloppyInDrive:Boolean;&lt;br&gt;&lt;br /&gt;
var om: Integer; //OlderrorModus&lt;br&gt;&lt;br /&gt;
begin&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a806-how-to-detect-if-diskdrive-contains-a-floppy.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a806-how-to-detect-if-diskdrive-contains-a-floppy.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Mon, 19 Apr 2004 23:00:00 -0500</pubDate>
 <dc:creator />
 <guid isPermaLink="false">79 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Invoking the windows Browse For Folder dialog</title>
 <link>http://www.howtodothings.com/computers/a847-invoking-the-windows-browse-for-folder-dialog.html</link>
 <description>&lt;p&gt;Borland&#039;s SelectDirectory browser is quite ugly, here is how to invoke the Windows one instead.&lt;br&gt;&lt;br&gt;uses&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;ShlObj, ShellAPI;&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
......&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
function BrowseForFolder(handle : HWND; strTitle : string; var strPath : string) : boolean;&lt;br&gt;&lt;br /&gt;
var info : TBROWSEINFO;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;path : array[0..MAX_PATH] of Char;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;items : PITEMIDLIST;&lt;br&gt;&lt;br /&gt;
begin&lt;br&gt;&lt;br /&gt;
&amp;nbsp;Result:=false;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;path:=&#039;&#039;;&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
&amp;nbsp;with info do&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;begin&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hwndOwner:=handle;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pidlRoot:=nil;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pszDisplayName:=nil;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lpszTitle:=PChar(strTitle);&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ulFlags:=BIF_RETURNONLYFSDIRS;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lpfn:=nil;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;end;&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
&amp;nbsp;items:=SHBrowseForFolder(info);&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
&amp;nbsp;if assigned(items) then&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;begin&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SHGetPathFromIDList(items,path);&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a847-invoking-the-windows-browse-for-folder-dialog.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a847-invoking-the-windows-browse-for-folder-dialog.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Tue, 16 Mar 2004 23:00:00 -0600</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">109 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>How to use DNS blocklists to detect spam</title>
 <link>http://www.howtodothings.com/computers/a871-how-to-use-dns-blocklists-to-detect-spam.html</link>
 <description>&lt;p&gt;One of the solutions to spam is a -frequent updated- database with IP addresses that appear to misbehave. This database should, preferably, be random accessible at high speed. DNS offers a solution for that.&lt;br&gt;&lt;br&gt;Introduction.&lt;br&gt;&lt;br /&gt;
Fortunately internet has found answers for the immens growing spam problem. A solution is a -frequent updated- database with IP addresses that appear to misbehave. This database should, preferably, be random accessible at high speed. DNS offers a solution for that.&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
DNS entries can be updated quickly. Also, mostly there is no need to download a copy of the (potentially large) database frequently. If a mail server can detect, in a fraction of a second, that the sending IP is currently blacklisted, for example because it was infected by a virus and used as open relay, it can effictively block reception.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a871-how-to-use-dns-blocklists-to-detect-spam.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a871-how-to-use-dns-blocklists-to-detect-spam.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Fri, 12 Mar 2004 23:00:00 -0600</pubDate>
 <dc:creator />
 <guid isPermaLink="false">129 at http://www.howtodothings.com</guid>
</item>
<item>
 <title>Persistent derived attributes</title>
 <link>http://www.howtodothings.com/computers/a870-persistent-derived-attributes.html</link>
 <description>&lt;p&gt;A small example of making derived attributes which are persisted to the database.&lt;br&gt;&lt;br&gt;Persistent derived attributes in Bold&lt;br&gt;&lt;br /&gt;
Bold&#039;s derived attributes are always evaluated in memory, this makes it impossible to perform an InPS (persistence storage) search against certain data. Any search expression which refers to a derived attribute will cause Bold to load all objects from the database into memory first for an in-memory evalution, this can be very slow and resource consuming.&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
Past discussions have been posted on the support groups asking how to achieve derived attributes which are also persisted to the DB for SQL evaluation. Today I had the same requirement, and this is the solution I came up with.&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
The first thing to do is to avoid marking the attribute as derived in the model.  Instead, make the attribute a persistent attribute, eg&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;i&gt;FullName: string (128)&lt;/i&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.howtodothings.com/computers/a870-persistent-derived-attributes.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.howtodothings.com/computers/a870-persistent-derived-attributes.html#comments</comments>
 <category domain="http://www.howtodothings.com/computers/c39-delphi.html">Delphi</category>
 <pubDate>Thu, 26 Feb 2004 23:00:00 -0600</pubDate>
 <dc:creator>Peter5</dc:creator>
 <guid isPermaLink="false">128 at http://www.howtodothings.com</guid>
</item>
</channel>
</rss>
