<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1881358427466534365</id><updated>2011-11-27T16:55:15.870-08:00</updated><title type='text'>Delphi Tips,Delphi News,Delphi Notes</title><subtitle type='html'>Share Delphi Learning Tips,Notes And Provide Latest Delphi News</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default?start-index=101&amp;max-results=100'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>187</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-2918843323153017296</id><published>2010-03-05T21:04:00.000-08:00</published><updated>2010-03-05T21:05:17.249-08:00</updated><title type='text'>Delphi Prism ASP.NET web chat service</title><content type='html'>Using Delphi 2010, we can build ASP.NET web services and projects, as I often demonstrate in my ASP.NET workshops and training events (in The Netherlands, UK and Sweden for example). In this article, I'll demonstrate how we can use Delphi Prism and ASP.NET to write a web chat service, consuming it in an ASP.NET web form as well. &lt;br /&gt;In order to participate with the demo of this month, you need a copy of Delphi Prism. After starting Delphi Prism, do File | New ?Project, and in the Web node of the Delphi Prism project types, select the ASP.NET Web Application. Specify WebChat as name of the application. This will create a new solution with one project called WebChat&lt;br /&gt;&lt;br /&gt;Unfortunately, inside the generated source code in file chat.asmx.pas the [WebMethod] attribute still appears above the implementation of the example method chat.HelloWorld instead of the definition of this method in the chat class. We need to move that attribute from the implementation to the definition. In fact, we don't need the entire HelloWorld method at all, so feel free to remove both the definition and implementation. &lt;br /&gt;For the chatroom example, I need two methods: one to send a chat message, and another to retrieve all chat messages.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-2918843323153017296?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/2918843323153017296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=2918843323153017296' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2918843323153017296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2918843323153017296'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2010/03/delphi-prism-aspnet-web-chat-service.html' title='Delphi Prism ASP.NET web chat service'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-1780738426858938175</id><published>2010-03-05T21:01:00.001-08:00</published><updated>2010-03-05T21:03:18.153-08:00</updated><title type='text'>Delphi 2010 Delayed Dynamic Link Libraries</title><content type='html'>Traditionally, Dynamic Link Libraries (DLLs) can be loaded in two different ways: implicit or explicit.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;unit&lt;/b&gt; DelayedHandler;&lt;br /&gt;&lt;b&gt;interface&lt;br /&gt;uses&lt;/b&gt;&lt;br /&gt;SysUtils;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;type&lt;/b&gt;&lt;br /&gt;ELoadLibrary = &lt;b&gt;class&lt;/b&gt;(Exception);&lt;br /&gt;EGetProcAddress = &lt;b&gt;class&lt;/b&gt;(Exception);&lt;br /&gt;&lt;br /&gt;&lt;b&gt;implementation&lt;br /&gt;&lt;br /&gt;function&lt;/b&gt; DelayedHandlerHook(dliNotify: dliNotification;&lt;br /&gt;pdli: PDelayLoadInfo): &lt;b&gt;Pointer&lt;/b&gt;; &lt;b&gt;stdcall&lt;/b&gt;;&lt;br /&gt;&lt;b&gt;begin&lt;br /&gt;if&lt;/b&gt; dliNotify = dliFailLoadLibrary &lt;b&gt;then&lt;/b&gt;&lt;br /&gt;&lt;b&gt;raise&lt;/b&gt; ELoadLibrary.Create('Could not load ' + pdli.szDll)&lt;br /&gt;&lt;b&gt;else&lt;br /&gt;if&lt;/b&gt; dliNotify = dliFailGetProcAddress &lt;b&gt;then&lt;br /&gt;if&lt;/b&gt; pdli.dlp.fImportByName &lt;b&gt;then&lt;br /&gt;raise&lt;/b&gt; EGetProcAddress.Create('Could not load ' +&lt;br /&gt;pdli.dlp.szProcName + ' from ' + pdli.szDll)&lt;br /&gt;&lt;b&gt;else&lt;br /&gt;raise&lt;/b&gt; EGetProcAddress.Create('Could not load index ' +&lt;br /&gt;IntToStr(pdli.dlp.dwOrdinal) + ' from ' + pdli.szDll)&lt;br /&gt;&lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;initialization&lt;/b&gt;&lt;br /&gt;SetDliFailureHook(DelayedHandlerHook);&lt;br /&gt;&lt;b&gt;finalization&lt;/b&gt;&lt;br /&gt;SetDliFailureHook(&lt;b&gt;nil&lt;/b&gt;);&lt;br /&gt;&lt;b&gt;end&lt;/b&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-1780738426858938175?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/1780738426858938175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=1780738426858938175' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/1780738426858938175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/1780738426858938175'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2010/03/delphi-2010-delayed-dynamic-link_05.html' title='Delphi 2010 Delayed Dynamic Link Libraries'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-2417423787036539008</id><published>2010-03-05T20:57:00.000-08:00</published><updated>2010-03-05T20:59:44.135-08:00</updated><title type='text'>C++Builder Developer’s Journal – Call for Papers out for May 2010 issue</title><content type='html'>The C++Builder Developer’s Journal is a great magazine run by some really dedicated guys. I’ve been a subscriber for quite awhile and find it almost always has a couple of articles I’m interested in. They are very often applicable to Delphi as well. Anyway, the May 2010 issue will be an open one, meaning it will be freely available to anyone, not just subscribers. They are running a Call for Papers right now, so if you’ve had an idea for an article burning away in the back of your mind, or just like the idea of the fame and fortune that comes with being a published author (yes, I kept a straight face while typing that. Getting good at this, aren’t I?) go and check it out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-2417423787036539008?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/2417423787036539008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=2417423787036539008' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2417423787036539008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2417423787036539008'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2010/03/cbuilder-developers-journal-call-for.html' title='C++Builder Developer’s Journal – Call for Papers out for May 2010 issue'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-3948945585305757973</id><published>2010-03-05T20:56:00.001-08:00</published><updated>2010-03-05T20:56:38.859-08:00</updated><title type='text'>Delphi Prism 2010 Does Not Seem To Use Subdirectories</title><content type='html'>When working on an ASP.NET website, I find it a lot easier if you put related sections in seperate subdirectories.  For example:&lt;br /&gt;&lt;br /&gt;CSS and Javascript can be put in a directory with caching in order to speed up the page loads&lt;br /&gt;&lt;br /&gt;Pages that are only available to certain roles (i.e. “Admin”) can be put in a seperate directory and then you set the web.config so that only that role can access the directory.  This helps to make it really clear who the page is ment for.&lt;br /&gt;&lt;br /&gt;While attempting to port a site from Delphi RAD 2007 to Delphi Prism 2010, I was amazed that it would not let me do this.  I even opened a site in Visual Web Developer 2008 (the Microsoft compeditor that Prism basically uses as the IDE) to check if it was a Microsoft issue.  Not only did the Microsoft Web Developer 2008 allow it, but when I went to create a code file, it suggested putting it into app_code and offered to move it there for me (but did not force me to if I didn’t want to).&lt;br /&gt;&lt;br /&gt;In comparison, in Delphi Prism 2010, I opened {project}\css\proj.css.  Instead of allowing me to use the file where it was, Prism created a brand new file {project}\proj.css and added that to the project.  To add to the confusion, it left the old file {project}\css\proj.css.  Now I have two copies of proj.css.  I tried it with several different files and kept having this issue.&lt;br /&gt;&lt;br /&gt;Not only is this annoying, I find that this really makes a larger site a lot harder to maintain.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-3948945585305757973?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/3948945585305757973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=3948945585305757973' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/3948945585305757973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/3948945585305757973'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2010/03/delphi-prism-2010-does-not-seem-to-use.html' title='Delphi Prism 2010 Does Not Seem To Use Subdirectories'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-1607549765953864725</id><published>2009-09-08T19:13:00.001-07:00</published><updated>2009-09-08T19:13:55.549-07:00</updated><title type='text'>SamplingProfiler v1.7.4</title><content type='html'>&lt;strong&gt;SamplingProfiler&lt;/strong&gt; v1.7.4 is now available. This version adds an option for Delphi 2010 paths, and fixes a big with the silent mode execution that would render it inoperative. There also have been other minor changes, mostly cosmetic.&lt;br /&gt;&lt;br /&gt;This release also includes preparation for an “attach to process” option, which is currently not enabled, but should hopefully make in the next version (available “when ready”).&lt;br /&gt;&lt;br /&gt;Delphi 2010 paths added to options.&lt;br /&gt;Fixed a bug in silent mode.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-1607549765953864725?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/1607549765953864725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=1607549765953864725' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/1607549765953864725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/1607549765953864725'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/09/samplingprofiler-v174.html' title='SamplingProfiler v1.7.4'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-4038643702279440602</id><published>2009-09-08T19:11:00.000-07:00</published><updated>2009-09-08T19:13:04.201-07:00</updated><title type='text'>What To Do When You Find a Bug in Your Program</title><content type='html'>&lt;strong&gt;No Go Answers&lt;/strong&gt;&lt;br /&gt;If possible pretend that you are the company's answering machine. "You have reached Acme LTD, we are sorry but all the support lines are busy. Please call back in 12 hours".&lt;br /&gt;Answer that you are sorry but the line is lousy and you did not hear the last sentence. Blib, zzp, blip. "Could you please call us back tomorrow, or when the lines are fixed?".&lt;br /&gt;Answer that you are sorry but the support team is on holidays and that they will be back in no time, in 3 months.&lt;br /&gt;Answer "I do not care, leave me alone, its Friday. You asked for the application now learn to live with it".&lt;br /&gt;&lt;strong&gt;No Go Doings&lt;/strong&gt;&lt;br /&gt;After you have reproduced the steps and actually found the bug:&lt;br /&gt;Introduce new, more severe bugs. The bug from the phone call will look like child's play. When this new bug is found, introduce another one. Just keep adding more bugs.&lt;br /&gt;Ignore the bug. Just continue adding extra functionality to the application. Maybe users will forget and never again run into it.&lt;br /&gt;Restart your development environment. If that does not help restart Windows. If that does not help restart Windows again.&lt;br /&gt;Locate the line of the source code that is responsible for the bug (note: this requires lots of your valuable time). Then do one of the following (or all):&lt;br /&gt;Delete the function containing the line of code that produces the bug. If you remove the cause - the consequence (bug) will go away. If, for example, the result of the function was a Boolean value, just make sure that sometimes false is returned and sometimes true is returned for the function result.&lt;br /&gt;Turn your head away from the monitor. Pretend that you are dead. Maybe it will go away.&lt;br /&gt;Turn your head away from the monitor. Pretend that you are dead. Try to scare the bug by quickly looking into the source code saying "bu". Repeat until the bug is gone or the code fixes itself.&lt;br /&gt;Delete the application source. Delete any marks the application ever existed. Pretend that you never created the program in the first place.&lt;br /&gt;Run. Run as fast as you can.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-4038643702279440602?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/4038643702279440602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=4038643702279440602' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4038643702279440602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4038643702279440602'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/09/what-to-do-when-you-find-bug-in-your.html' title='What To Do When You Find a Bug in Your Program'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-1380557059758815708</id><published>2009-09-06T20:08:00.000-07:00</published><updated>2009-09-06T20:10:38.349-07:00</updated><title type='text'>Search your HTML documentation with HelpNDoc 2.2</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_e42QR63MTVU/SqR5oieBRgI/AAAAAAAAAD0/HCrhs3Gn-UQ/s1600-h/html-search-feature.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5378557592341661186" style="FLOAT: right; MARGIN: 0px 0px 10px 10px; WIDTH: 254px; CURSOR: hand; HEIGHT: 197px" alt="" src="http://2.bp.blogspot.com/_e42QR63MTVU/SqR5oieBRgI/AAAAAAAAAD0/HCrhs3Gn-UQ/s400/html-search-feature.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;HelpNDoc 2.2 introduces a custom made JavaScript search engine to power the client-side searching functionality of the HTML generated documentation. This means that, without any complicated server-side technology, users will be able to search your HTML documentation with ease and speed.&lt;br /&gt;PDF Generation is now more robust and the external files functionality has been totally rewritten to better handle HTML and Word documentation import. It is now easier than ever to include external files in topics. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-1380557059758815708?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/1380557059758815708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=1380557059758815708' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/1380557059758815708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/1380557059758815708'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/09/search-your-html-documentation-with.html' title='Search your HTML documentation with HelpNDoc 2.2'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_e42QR63MTVU/SqR5oieBRgI/AAAAAAAAAD0/HCrhs3Gn-UQ/s72-c/html-search-feature.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-8307830909016064456</id><published>2009-09-06T20:07:00.000-07:00</published><updated>2009-09-06T20:08:04.466-07:00</updated><title type='text'>Delphi 2010 migration was a beeze; samples/slides will be uploaded soon</title><content type='html'>This week, I found some time do migrate all the sample projects to the release versions of Delphi Win32 2010 and Delphi Prism 2010.&lt;br /&gt;&lt;br /&gt;Delphi Win32 2010 works like a charm: it is much faster and has a much smaller footprint than any other Galileo based IDE.&lt;br /&gt;In fact, it feels almost as fast as the pre-Galileo based IDE’s.&lt;br /&gt;With the added benefit that all the new features make me much more productive, not the least because it has not yet crashed on me this week once.&lt;br /&gt;Crashing has been a frequent thing on me since Delphi 4 (maybe I should not even mention that number ), for most IDE’s at least a couple of times a week, so this is good.&lt;br /&gt;&lt;br /&gt;Delphi Prism 2010 works really nice too, it is rock solid, and the language as some great features not found in other .NET languages.&lt;br /&gt;But it still needs a tiny bit more polishing on the Visual Studio IDE Integration part.&lt;br /&gt;There are a few things not as smoothly integrated as I’m used to in C# and VB .NET (for instance when adding assembly references; C# and VB.NET allow you to do that from multiple places in the IDE; Delphi Prism from only one).&lt;br /&gt;I know it is nitpicking (the same holds for the Team Foundation System integration in the Visual Studio IDE: ever tried to add files or folders? There is only one icon that allows you to do it. Ever tried to move files or folders around? No way you can drag &amp;amp; drop, in fact you can move only 1 file or folder at a time, and then the folder tree leaves you at the target).&lt;br /&gt;&lt;br /&gt;The Embarcadero folks have worked hard on developer productivity in the Delphi Win32 2010 IDE.&lt;br /&gt;(Did I mention the F6 key? It is an awesome way of directly jumping into configuration dialogs a zillion levels deep.&lt;br /&gt;Did I mention the Ctrl-D key? It instantly reformats your source code to your formatting settings).&lt;br /&gt;So maybe it is now time to put some of that effort into the Prism side as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-8307830909016064456?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/8307830909016064456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=8307830909016064456' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8307830909016064456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8307830909016064456'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/09/delphi-2010-migration-was-beeze.html' title='Delphi 2010 migration was a beeze; samples/slides will be uploaded soon'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-2859500470701423826</id><published>2009-09-06T20:04:00.001-07:00</published><updated>2009-09-06T20:04:59.910-07:00</updated><title type='text'>PDFtoolkit VCL v3.3</title><content type='html'>Gnostice PDFtoolkit is a comprehensive and versatile PDF component suite for Delphi™ and C++Builder®. PDFtoolkit VCL components come with hundreds of functions and properties that put immense power in the hands of the developer. PDFtoolkit hides the complexity of the PDF format and allows developers to easily create applications that can edit, enhance, secure, merge, split, view, digitally sign, and print PDF documents and process PDF forms. PDFtoolkit can extract text, export to images, and also add digital signatures.&lt;br /&gt;&lt;br /&gt;PDFtoolkit does not require PDF software such as Adobe PDF library, Adobe Acrobat Professional, Adobe PDF Reader or GhostScript.&lt;br /&gt;&lt;br /&gt;Note: PDFtoolkit works on existing documents. For creating new PDF documents in Delphi or C++Builder, you can use eDocEngine VCL. For other platforms, we have PDFOne .NET and PDFOne Java, which can create PDF documents from scratch as well as modify existing PDF documents.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-2859500470701423826?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/2859500470701423826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=2859500470701423826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2859500470701423826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2859500470701423826'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/09/pdftoolkit-vcl-v33.html' title='PDFtoolkit VCL v3.3'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-286602331185950515</id><published>2009-09-06T20:01:00.000-07:00</published><updated>2009-09-06T20:03:31.669-07:00</updated><title type='text'>Memory Manager Tool FastMM 4.94</title><content type='html'>FastMM is a lightning fast replacement memory manager for Borland Delphi Win32 applications that scales well in multi-threaded applications, is not prone to memory fragmentation, and supports shared memory without the use of external .DLL files.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sourceforge.net/projects/fastmm/" target="blank"&gt;download&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-286602331185950515?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/286602331185950515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=286602331185950515' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/286602331185950515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/286602331185950515'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/09/memory-manager-tool-fastmm-494.html' title='Memory Manager Tool FastMM 4.94'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-81539956253711740</id><published>2009-09-06T19:59:00.000-07:00</published><updated>2009-09-06T20:01:29.599-07:00</updated><title type='text'>TurboPower Orpheus  4.06 for Delphi 2010</title><content type='html'>Orpheus is an award-winning UI toolkit for Borland Delphi &amp;amp;C++Builder. It contains over 120 components covering everything fromdata entry to calendars and clocks. Other noteworthy componentsinclude an Object Inspector, LookOut bar, &amp;amp; report views.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sourceforge.net/projects/tporpheus/" target="blank"&gt;download&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-81539956253711740?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/81539956253711740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=81539956253711740' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/81539956253711740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/81539956253711740'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/09/turbopower-orpheus-406-for-delphi-2010.html' title='TurboPower Orpheus  4.06 for Delphi 2010'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-7592414893426445053</id><published>2009-09-06T19:58:00.000-07:00</published><updated>2009-09-06T19:59:48.978-07:00</updated><title type='text'>IDE Fix Pack 2010 – ObjectInspector F1 key</title><content type='html'>I got many requests to add a patch for the non-functioning F1 key in the Object Inspector. So I spend 2 hours trying to find out where the F1 got lost and what Delphi 2009 does what 2010 doesn’t. My research showed that Delphi 2009 calls a function named “ShowPropertyHelp” while Delphi 2010 skips this call. Before the call to ShowPropertyHelp there is a call to a function named “GetTrait”.In Delphi 2009 it returns an interface while in Delphi 2010 it returns nil.&lt;br /&gt;&lt;br /&gt;Then I remembered that I saw something in ToolsAPI.pas that was called “Traits”. So I looked into it and found the IOTAPersonalityServices interface. By analyzing the GetTrait “call parameters” I was able to extract the GUID that is used for the IOTAPersonalityServices.GetTrait(ATraitGUID) parameter. It seems that in Delphi 2010 the Property-Help trait is missing or GetTrait doesn’t return it.&lt;br /&gt;&lt;br /&gt;The next step was to try to add the “trait” by calling the IOTAPersonalityServices.AddPersonalityTrait method with the personality ID and the extracted GUID. And vólà the F1 key in the Object Inspector is back.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-7592414893426445053?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/7592414893426445053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=7592414893426445053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/7592414893426445053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/7592414893426445053'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/09/ide-fix-pack-2010-objectinspector-f1.html' title='IDE Fix Pack 2010 – ObjectInspector F1 key'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-7370699802310020107</id><published>2009-09-03T18:43:00.001-07:00</published><updated>2009-09-03T18:43:46.484-07:00</updated><title type='text'>Class (, Static, or Shared) Constructors (and Destructors)</title><content type='html'>&lt;strong&gt;Improved encapsulation&lt;/strong&gt;&lt;br /&gt;How many times have you needed to initialize something related to a specific class? What if your class is using the singleton pattern and you need to create that single instance? How about registering the class with a “class-factory?” Prior to Delphi 2010, there were several options available to you, none of which were really in keeping with the OOP notion of encapsulation. You could put all the code into the initialization section of the unit in which the class lived, add a regular class method and call it explicitly, or manually integrate the init code into your application’s startup. By moving all this code into a class constructor, the mere act of “touching” the class will cause the class constructor to run in keeping with the above rules.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Better control over smart-linking&lt;/strong&gt;&lt;br /&gt;Loosely coupled with improved encapsulation is the notion that by moving any initialization code into the class constructor you have a little more control over what code is linked into your application. You can now take advantage of the fact that as long as the class type isn’t referenced referenced anywhere in your code, none of the code related to the class type is linked in, including the VMT, virtual methods, RTTI, etc.. If you had placed this init code into the initialization section of its containing unit, then at least the VMT, virtual methods and RTTI would have been linked into your application. Even though none of your code references it. The new enhanced RTTI throws an interesting wrinkle to this theory, but that will have to be covered later.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Better language compatibility with Delphi Prism&lt;/strong&gt;&lt;br /&gt;As Delphi Prism gains popularity, more people will need to maintain some of their code in a manner that they can compile with either compiler. There are still many language constructors that both compilers have that the other doesn’t, but this is a continuing effort to close that gap where it makes sense. Expect to see more work in this area, in both compilers.&lt;br /&gt;&lt;br /&gt;In my next post, we’ll “pop the hood” (or bonnet, for our good friends across the pond) and take a peek at how they work and exactly when they are invoked. I will say that many people tend to read way, way too much into this simple statement describing when a class constructor is invoked; “Called automatically to initialize the class before the first instance is created or any static members are referenced.” The only temporal reference in that statement is “…before…”. I will leave you to consider the implications of that word, lest many of you begin to talk about “threading issues” and “code-bloat.” Class constructors and destructors are to classes as initialization and finalization are to units.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-7370699802310020107?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/7370699802310020107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=7370699802310020107' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/7370699802310020107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/7370699802310020107'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/09/class-static-or-shared-constructors-and.html' title='Class (, Static, or Shared) Constructors (and Destructors)'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-2609152709431041847</id><published>2009-09-03T18:39:00.000-07:00</published><updated>2009-09-03T18:40:10.477-07:00</updated><title type='text'>SmartInspect now supports Delphi 2010</title><content type='html'>We have just released a new version of our .NET, Java and Delphi logging tool SmartInspect that supports the new Delphi 2010. Embarcadero’s latest Delphi version looks like a very solid release and we have seen other people report that there are good chances that Delphi 2010 will become the new reference version for many years to come.&lt;br /&gt;&lt;br /&gt;As usual, existing SmartInspect customers can download the new release from our customer portal. If you are interested in giving SmartInspect a try, please download the updated trial version with Delphi 2010 support from our website.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-2609152709431041847?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/2609152709431041847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=2609152709431041847' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2609152709431041847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2609152709431041847'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/09/smartinspect-now-supports-delphi-2010.html' title='SmartInspect now supports Delphi 2010'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-8060001841233429369</id><published>2009-09-02T18:25:00.000-07:00</published><updated>2009-09-02T18:26:33.342-07:00</updated><title type='text'>Delphi 2010’s RTTI and Active Scripting</title><content type='html'>I’ve been playing around with the new RTTI stuff in the D2010 trial, and I have to say, I’m impressed. But for what it surfaces for method pointers (= event types) and sets, it seems both very complete and very intuitive to use. Not only have I managed to use it without having reference to either source code or an API reference (though let’s not encourage Embarcadero on the latter, eh?), but it has been generally very solid — do something wrong, and an appropriate exception is cleanly raised with a message that tells you straighaway what the issue is. The one (er) exception to this is TValue not doing quite enough verification when attempting a cast to a Variant, though as the latter is an explicit operation, it’s easy enough to work around if and when it bites.&lt;br /&gt;&lt;br /&gt;That said, reading the small amount of documentation, I happened across mention of an Invoke method, which set me thinking — is it finally possible to cleanly (and generically!) wrap Delphi objects into IDispatch ones for use in Active Scripting? Well, apart from the events issue and the difficulties of surfacing set types in a script-friendly manner, my answer is: for sure! Check out this compiled EXE if you’re interested (screenshot here).&lt;br /&gt;&lt;br /&gt;Basically, what I’ve done is to write a TCustomDispProxy class with TObjectDispProxy and TClassDispProxy descendants; in the demo, these are then used to directly surface the Application, Mouse and Screen objects, together with the form instance (object properties and fields are handled automatically) and some metaclasses (TButton, TLabel, etc.).The idea is that no specific object or class type requires a specific wrapper — all just use TObjectDispProxy and TClassDispProxy respectively, with wrappers for sub-objects created on the fly. Now unlike Allen Bauer, I’m not a masochist in these things, and so have used the MS Script Control rather than implemented the Active Scripting interfaces directly; because of this, be warned that if the control isn’t installed (which is unlikely these days, though could be the case), the EXE won’t run.&lt;br /&gt;&lt;br /&gt;Anyhow, if anyone’s interested in the actual code, add a comment saying so and I’ll endeavour to do it up for public consumption. Alternatively, if you’re not interested, then don’t leave a comment and I won’t bother&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-8060001841233429369?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/8060001841233429369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=8060001841233429369' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8060001841233429369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8060001841233429369'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/09/delphi-2010s-rtti-and-active-scripting.html' title='Delphi 2010’s RTTI and Active Scripting'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-8740960246154473638</id><published>2009-09-02T18:17:00.000-07:00</published><updated>2009-09-02T18:23:52.128-07:00</updated><title type='text'>Custom Marshalling/UnMarshalling in Delphi 2010</title><content type='html'>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br /&gt;Some days ago, Embarcadero has presented the new version of RAD Studio, 2010.&lt;br /&gt;The are many new features, but you can find in a lot places around the web, so&lt;br /&gt;I won’t repeat them here.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;One of the things widely requested from all Delphi programmers all over the world over the past few years, including myself, is&lt;br /&gt;certainly a new and more powerful RTTI.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The new system of RTTI has finally arrived, and pave the way for a large number of applications.&lt;br /&gt;One area that has benefited from the new RTTI is for sure the marshaled objects.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Marshaling is defined as follows:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;“In computer science, marshalling (similar to serialization) is the process of&lt;br /&gt;transforming the memory representation of an object to a data format suitable for&lt;br /&gt;storage or transmission. It is typically used when data must be moved between&lt;br /&gt;different parts of a computer program or from one program to another.&lt;br /&gt;The opposite, or reverse, of marshalling is called unmarshalling (demarshalling) (similar to deserialization).”&lt;br /&gt;–WikiPedia&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In Delphi 2010 the process of serialization and deserialization is handled respectively by a Marshaller and an Unmarshaller.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The built-in format for the serialization of any Delphi object is JSON.&lt;br /&gt;There are 2 main classes responsible for serializing objects into JSON, both present in the unit DBXJSONReflect:&lt;br /&gt;- TJSONMarshal&lt;br /&gt;- TJSONUnMarshal&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Let’s say you have an object defined as follow:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-collapsed"&gt;&lt;a name="#codesyntax1"&gt;&lt;/a&gt;Code&lt;/div&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-inner" style="DISPLAY: none"&gt;&lt;pre class="delphi" style="FONT-FAMILY: monospace"&gt;&lt;ol&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;type&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  TKid &lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;class&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    FirstName&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;String&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    LastName&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;String&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Age&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;Integer&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;To serialize and deserialize an instance of TKid it requires the following steps:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-expanded"&gt;&lt;a name="#codesyntax2"&gt;&lt;/a&gt;Code&lt;/div&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-inner"&gt;&lt;pre class="delphi" style="FONT-FAMILY: monospace"&gt;&lt;ol&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Mar&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TJSONMarshal&lt;span style="color:#000066;"&gt;;&lt;/span&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//Serializer&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  UnMar&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TJSONUnMarshal&lt;span style="color:#000066;"&gt;;&lt;/span&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//UnSerializer&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Kid&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TKid&lt;span style="color:#000066;"&gt;;&lt;/span&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//The Object to serialize&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  SerializedKid&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TJSONObject&lt;span style="color:#000066;"&gt;;&lt;/span&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//Serialized for of object&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Mar &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TJSONMarshal&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Create&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TJSONConverter&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Create&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;try&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Kid &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TKid&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Create&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;try&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      Kid&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;FirstName&lt;/span&gt; &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;'Daniele'&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      Kid&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;LastName&lt;/span&gt; &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;'Teti'&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      Kid&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Age&lt;/span&gt; &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;29&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      SerializedKid &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; Mar&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Marshal&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Kid&lt;span style="color:#000066;"&gt;)&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;as&lt;/span&gt; TJSONObject&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;finally&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="color:#000066;"&gt;FreeAndNil&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Kid&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;finally&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Mar&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Free&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//Output the JSON version of the Kid object&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="color:#000066;"&gt;WriteLn&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;SerializedKid&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;ToString&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;// UnMarshalling Kid&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  UnMar &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TJSONUnMarshal&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Create&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;try&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Kid &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; UnMar&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;UnMarshal&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;SerializedKid&lt;span style="color:#000066;"&gt;)&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;as&lt;/span&gt; TKid&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;try&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//now kid is the same as before marshalling&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Kid&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;FirstName&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;'Daniele'&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Kid&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;LastName&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;'Teti'&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Kid&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Age&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;29&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;finally&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      Kid&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Free&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;finally&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    UnMar&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Free&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Simple, isn’t it?&lt;br /&gt;To access the JSON string that is our object, we must call the method ToString.&lt;br /&gt;The JSON representation of this object SerializedKid can be saved to file,&lt;br /&gt;sent to a remote server, used by a Web page from a web service, stored on a database or sent into space (!!!).&lt;br /&gt;The Delphi application re-read the JSON string, you can recreate the object as it was at the time of serialization.&lt;br /&gt;But anyone with a JSON parser can still read the data in our object, even non Delphi client.&lt;br /&gt;These are the advantages of having used an open format and standard.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;So far the simple part …&lt;/strong&gt;&lt;br /&gt;How serialize a field differently from the default?&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Suppose we add the date of birth to our TKid:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-expanded"&gt;&lt;a name="#codesyntax3"&gt;&lt;/a&gt;Code&lt;/div&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-inner"&gt;&lt;pre class="delphi" style="FONT-FAMILY: monospace"&gt;&lt;ol&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;type&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  TKid &lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;class&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    FirstName&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;String&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    LastName&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;String&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Age&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;Integer&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    BornDate&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TDateTime&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Serialize a TDateTime, localized and that I have in JSON string is a float, because for Delphi TDateTime is a decimal number.&lt;br /&gt;If I read the data from another program Delphi, no problem, but if I wanted to read a script in JavaScript? or. NET? or Ruby?&lt;br /&gt;Then I use a format “DATA” to understand, even for these languages.&lt;br /&gt;The new engine provides the serialization too.&lt;br /&gt;Is needed, however, to tell the Marshaller and UnMarsheller how to represent and reconstruct a particular&lt;br /&gt;object field by two statements like the following:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-collapsed"&gt;&lt;a name="#codesyntax4"&gt;&lt;/a&gt;Code&lt;/div&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-inner" style="DISPLAY: none"&gt;&lt;pre class="delphi" style="FONT-FAMILY: monospace"&gt;&lt;ol&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//marshaller&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;Marshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;RegisterConverter&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TKid&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;'BornDate'&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Field&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    ctx&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TRttiContext&lt;span style="color:#000066;"&gt;;&lt;/span&gt; &lt;span style="color:#000066;"&gt;date&lt;/span&gt; &lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TDateTime&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="color:#000066;"&gt;date&lt;/span&gt; &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; ctx&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetType&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;ClassType&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetField&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Field&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetValue&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;AsType&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Result &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="color:#000066;"&gt;FormatDateTime&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;'yyyy-mm-dd hh:nn:ss'&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#000066;"&gt;date&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//UnMarshaller&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;UnMarshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;RegisterReverter&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TKid&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;'BornDate'&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;procedure&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Field&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Arg&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    ctx&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TRttiContext&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    datetime&lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TDateTime&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    datetime &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; EncodeDateTime&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;1&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;4&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                               &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;6&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                               &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;9&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                               &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;12&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                               &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;15&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                               &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;18&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;0&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    ctx&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetType&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;ClassType&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetField&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Field&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;SetValue&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;,&lt;/span&gt; datetime&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The anonymous method is called when the marshaller serializes the field ‘BornDate’ is called “Converter” while Unmarshaller anonymous method that calls when he has to reconstruct the object from the JSON string is the “Reverter”.&lt;br /&gt;Thus serializing a TKid assure you that my object is readable both by Delphi from another language without loss of information.&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;But what happens when I have to serialize a complex type?&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Suppose we extend TKid this:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-expanded"&gt;&lt;a name="#codesyntax5"&gt;&lt;/a&gt;Code&lt;/div&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-inner"&gt;&lt;pre class="delphi" style="FONT-FAMILY: monospace"&gt;&lt;ol&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;type&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  TTeenager &lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;class&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TKid&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Phones&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TStringList&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;constructor&lt;/span&gt; Create&lt;span style="color:#000066;"&gt;;&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;virtual&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;destructor&lt;/span&gt; Destroy&lt;span style="color:#000066;"&gt;;&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;virtual&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;We must define a Converter and a Reverter for the TStringList class.&lt;br /&gt;We can do it this way:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-collapsed"&gt;&lt;a name="#codesyntax6"&gt;&lt;/a&gt;Code&lt;/div&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-inner" style="DISPLAY: none"&gt;&lt;pre class="delphi" style="FONT-FAMILY: monospace"&gt;&lt;ol&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Marshaller&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TJSONMarshal&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  UnMarshaller&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TJSONUnMarshal&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Teenager&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TTeenager&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Value&lt;span style="color:#000066;"&gt;,&lt;/span&gt; JSONTeenager&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TJSONObject&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Marshaller &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TJSONMarshal&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Create&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TJSONConverter&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Create&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;try&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Marshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;RegisterConverter&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TTeenager&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;'BornDate'&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Field&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        ctx&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TRttiContext&lt;span style="color:#000066;"&gt;;&lt;/span&gt; &lt;span style="color:#000066;"&gt;date&lt;/span&gt; &lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TDateTime&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        &lt;span style="color:#000066;"&gt;date&lt;/span&gt; &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; ctx&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetType&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;ClassType&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetField&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Field&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetValue&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;AsType&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        Result &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="color:#000066;"&gt;FormatDateTime&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;'yyyy-mm-dd hh:nn:ss'&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#000066;"&gt;date&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Marshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;RegisterConverter&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TStringList&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TListOfStrings&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                              &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                                i&lt;span style="color:#000066;"&gt;,&lt;/span&gt; count&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;integer&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                              &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                                count &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TStringList&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;count&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                                &lt;span style="color:#000066;"&gt;SetLength&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Result&lt;span style="color:#000066;"&gt;,&lt;/span&gt; count&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                                &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;for&lt;/span&gt; i &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;0&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;to&lt;/span&gt; count &lt;span style="color:#000066;"&gt;-&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;1&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;do&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                                  Result&lt;span style="color:#000066;"&gt;[&lt;/span&gt;i&lt;span style="color:#000066;"&gt;]&lt;/span&gt; &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TStringList&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;[&lt;/span&gt;i&lt;span style="color:#000066;"&gt;]&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                              &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//TStringList Converter&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Teenager &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TTeenager&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;CreateAndInitialize&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;try&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      Value &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; Marshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Marshal&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Teenager&lt;span style="color:#000066;"&gt;)&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;as&lt;/span&gt; TJSONObject&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;finally&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      Teenager&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Free&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;finally&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Marshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Free&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;// UnMarshalling Teenager&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  UnMarshaller &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TJSONUnMarshal&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Create&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;try&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    UnMarshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;RegisterReverter&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TTeenager&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;'BornDate'&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;procedure&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Field&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Arg&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        ctx&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TRttiContext&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        datetime&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TDateTime&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        datetime &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; EncodeDateTime&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;1&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;4&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                   &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;6&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                   &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;9&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                   &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;12&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                   &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;15&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                   &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;18&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;0&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        ctx&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetType&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;ClassType&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetField&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Field&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;SetValue&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;,&lt;/span&gt; datetime&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    UnMarshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;RegisterReverter&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TStringList&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TListOfStrings&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                               &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                                 StrList&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TStringList&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                                 &lt;span style="color:#000066;"&gt;Str&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                               &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                                 StrList &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TStringList&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Create&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                                 &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;for&lt;/span&gt; &lt;span style="color:#000066;"&gt;Str&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;in&lt;/span&gt; Data &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;do&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                                   StrList&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Add&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Str&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                                 Result &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; StrList&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;                                               &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//TStringList Reverter&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Teenager &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; UnMarshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Unmarshal&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Value&lt;span style="color:#000066;"&gt;)&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;as&lt;/span&gt; TTeenager&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;try&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;'Daniele'&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Teenager&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;FirstName&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;'Teti'&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Teenager&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;LastName&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;29&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Teenager&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Age&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;EncodeDate&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;1979&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;11&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;4&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Teenager&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;BornDate&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;3&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Teenager&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Phones&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Count&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;'NUMBER01&amp;amp;#8242;=Teenager.Phones[0]);&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;      Assert('&lt;/span&gt;NUMBER02&amp;amp;&lt;span style="color:#ff0000;"&gt;#824&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt;Teenager&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Phones&lt;/span&gt;&lt;span style="color:#000066;"&gt;[&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;1&lt;/span&gt;&lt;span style="color:#000066;"&gt;]&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;'NUMBER03&amp;amp;#8242;=Teenager.Phones[2]);&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;    finally&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;      Teenager.Free;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;    end;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;  finally&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;    UnMarshaller.Free;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;  end;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;end;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;There are different types of Converter and Reverter.&lt;br /&gt;In the the DBXJSONReflect there are 8 types of converters:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-collapsed"&gt;&lt;a name="#codesyntax7"&gt;&lt;/a&gt;Code&lt;/div&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-inner" style="DISPLAY: none"&gt;&lt;pre class="delphi" style="FONT-FAMILY: monospace"&gt;&lt;ol&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt; &lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//Convert a field in an object array&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  TObjectsConverter &lt;span style="color:#000066;"&gt;=&lt;/span&gt; reference &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;to&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Field&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;String&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TListOfObjects&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//Convert a field in a strings array&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  TStringsConverter &lt;span style="color:#000066;"&gt;=&lt;/span&gt; reference &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;to&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Field&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TListOfStrings&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//Convert a type in an objects array&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  TTypeObjectsConverter &lt;span style="color:#000066;"&gt;=&lt;/span&gt; reference &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;to&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TListOfObjects&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//Convert a type in a strings array&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  TTypeStringsConverter &lt;span style="color:#000066;"&gt;=&lt;/span&gt; reference &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;to&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TListOfStrings&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//Convert a field in an object&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  TObjectConverter &lt;span style="color:#000066;"&gt;=&lt;/span&gt; reference &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;to&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Field&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;String&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//Convert a field in a string&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  TStringConverter &lt;span style="color:#000066;"&gt;=&lt;/span&gt; reference &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;to&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Field&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//Convert specified type in an object&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  TTypeObjectConverter &lt;span style="color:#000066;"&gt;=&lt;/span&gt; reference &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;to&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//Convert specified type in a string&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  TTypeStringConverter &lt;span style="color:#000066;"&gt;=&lt;/span&gt; reference &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;to&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Each of them deals with a particular conversion object representation in the final serialization, in our case we will use them to convert to JSON.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Also in the DBXJSONReflect unit are defined many “Reverter” dealing with retrieving&lt;br /&gt;the serialized version of the data and use it to reconstruct the object previously serialized.&lt;br /&gt;Because they are complementary to the Converter, I will not copy them here.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;As a final example, we derive from TProgrammer by TTeenager adding a list of Laptops in the properties.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Is therefore necessary to introduce a new pair of Converter / Reverter.&lt;br /&gt;In this example I have defined all the converter and reverter in another unit in&lt;br /&gt;order to have more readable code:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-expanded"&gt;&lt;a name="#codesyntax8"&gt;&lt;/a&gt;&lt;a onclick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];&amp;#9;if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} &amp;#9;else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}" href="http://www.danieleteti.it/?p=146#codesyntax8"&gt;Code&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-inner"&gt;&lt;pre class="delphi" style="FONT-FAMILY: monospace"&gt;&lt;ol&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;type&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  TLaptop &lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;class&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Model&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;String&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Price&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;Currency&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;constructor&lt;/span&gt; Create&lt;span style="color:#000066;"&gt;(&lt;/span&gt;AModel&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;String&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; APrice&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;Currency&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  TLaptops &lt;span style="color:#000066;"&gt;=&lt;/span&gt; TObjectList&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  TProgrammer &lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;class&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TTeenager&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Laptops&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TLaptops&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;constructor&lt;/span&gt; Create&lt;span style="color:#000066;"&gt;;&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;override&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;destructor&lt;/span&gt; Destroy&lt;span style="color:#000066;"&gt;;&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;override&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;class&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt; CreateAndInitialize&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TProgrammer&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-STYLE: italic;color:#808080;" &gt;// Implementation code&amp;amp;#8230;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Marshaller&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TJSONMarshal&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  UnMarshaller&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TJSONUnMarshal&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Programmer&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TProgrammer&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Value&lt;span style="color:#000066;"&gt;,&lt;/span&gt; JSONProgrammer&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TJSONObject&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Marshaller &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TJSONMarshal&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Create&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TJSONConverter&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Create&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;try&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Marshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;RegisterConverter&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TProgrammer&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;'BornDate'&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; ISODateTimeConverter&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Marshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;RegisterConverter&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TStringList&lt;span style="color:#000066;"&gt;,&lt;/span&gt; StringListConverter&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Marshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;RegisterConverter&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TProgrammer&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;'Laptops'&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; LaptopListConverter&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Programmer &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TProgrammer&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;CreateAndInitialize&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;try&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      Value &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; Marshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Marshal&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Programmer&lt;span style="color:#000066;"&gt;)&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;as&lt;/span&gt; TJSONObject&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;finally&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      Programmer&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Free&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;// UnMarshalling Programmer&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    UnMarshaller &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TJSONUnMarshal&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Create&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;try&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      UnMarshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;RegisterReverter&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TProgrammer&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;'BornDate'&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; ISODateTimeReverter&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      UnMarshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;RegisterReverter&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TStringList&lt;span style="color:#000066;"&gt;,&lt;/span&gt; StringListReverter&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      UnMarshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;RegisterReverter&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TProgrammer&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;'Laptops'&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; LaptopListReverter&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      Programmer &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; UnMarshaller&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Unmarshal&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Value&lt;span style="color:#000066;"&gt;)&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;as&lt;/span&gt; TProgrammer&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;try&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;'Daniele'&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Programmer&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;FirstName&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;'Teti'&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Programmer&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;LastName&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;29&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Programmer&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Age&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;EncodeDate&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;1979&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;11&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;4&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Programmer&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;BornDate&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;3&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Programmer&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Phones&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Count&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;'NUMBER01&amp;amp;#8242; = Programmer.Phones[0]);&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;        Assert('&lt;/span&gt;NUMBER02&amp;amp;&lt;span style="color:#ff0000;"&gt;#824&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Programmer&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Phones&lt;/span&gt;&lt;span style="color:#000066;"&gt;[&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;1&lt;/span&gt;&lt;span style="color:#000066;"&gt;]&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;'NUMBER03&amp;amp;#8242; = Programmer.Phones[2]);&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;        Assert('&lt;/span&gt;HP Presario C700&amp;amp;&lt;span style="color:#ff0000;"&gt;#824&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Programmer&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Laptops&lt;/span&gt;&lt;span style="color:#000066;"&gt;[&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;0&lt;/span&gt;&lt;span style="color:#000066;"&gt;]&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Model&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;1000&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Programmer&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Laptops&lt;/span&gt;&lt;span style="color:#000066;"&gt;[&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;0&lt;/span&gt;&lt;span style="color:#000066;"&gt;]&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Price&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;'Toshiba Satellite Pro'&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Programmer&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Laptops&lt;/span&gt;&lt;span style="color:#000066;"&gt;[&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;1&lt;/span&gt;&lt;span style="color:#000066;"&gt;]&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Model&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;800&lt;/span&gt; &lt;span style="color:#000066;"&gt;=&lt;/span&gt; Programmer&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Laptops&lt;/span&gt;&lt;span style="color:#000066;"&gt;[&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;1&lt;/span&gt;&lt;span style="color:#000066;"&gt;]&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Price&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;        &lt;span style="color:#000066;"&gt;Assert&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;'IBM Travelmate 500&amp;amp;#8242; = Programmer.Laptops[2].Model);&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;        Assert(1300 = Programmer.Laptops[2].Price);&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;      finally&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;        Programmer.Free;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;      end;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;    finally&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;      UnMarshaller.Free;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;    end;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;  finally&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;    Marshaller.Free;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;  end;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="color:#ff0000;"&gt;end;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Unit CustomConverter.pas contains all needed Converters/Reverts as anon methods.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-expanded"&gt;&lt;a name="#codesyntax9"&gt;&lt;/a&gt;&lt;a onclick="javascript:wpContainer=this.parentNode.parentNode.getElementsByTagName('div')[1];&amp;#9;if(wpContainer.style.display=='none') {wpContainer.style.display=''; this.parentNode.className='wp-synhighlighter-expanded'} &amp;#9;else {wpContainer.style.display='none'; this.parentNode.className='wp-synhighlighter-collapsed'}" href="http://www.danieleteti.it/?p=146#codesyntax9"&gt;Code&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="wp-synhighlighter-inner"&gt;&lt;pre class="delphi" style="FONT-FAMILY: monospace"&gt;&lt;ol&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;unit&lt;/span&gt; CustomConverter&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;interface&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;uses&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  DBXJSONReflect&lt;span style="color:#000066;"&gt;,&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  MyObjects&lt;span style="color:#000066;"&gt;;&lt;/span&gt; &lt;span style="FONT-STYLE: italic;color:#808080;" &gt;//Needed by converter and reverter for TLaptops&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  ISODateTimeConverter&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TStringConverter&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  ISODateTimeReverter&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TStringReverter&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  StringListConverter&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TTypeStringsConverter&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  StringListReverter&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TTypeStringsReverter&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  LaptopListConverter&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TObjectsConverter&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  LaptopListReverter&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TObjectsReverter&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;implementation&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;uses&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  SysUtils&lt;span style="color:#000066;"&gt;,&lt;/span&gt; RTTI&lt;span style="color:#000066;"&gt;,&lt;/span&gt; DateUtils&lt;span style="color:#000066;"&gt;,&lt;/span&gt; Classes&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;initialization&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;LaptopListConverter &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Field&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;String&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TListOfObjects&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Laptops&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TLaptops&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  i&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;integer&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Laptops &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TProgrammer&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Laptops&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="color:#000066;"&gt;SetLength&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Result&lt;span style="color:#000066;"&gt;,&lt;/span&gt; Laptops&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Count&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;if&lt;/span&gt; Laptops&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Count&lt;/span&gt; &amp;gt; &lt;span style="color:#0000ff;"&gt;0&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;then&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;for&lt;/span&gt; I &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;0&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;to&lt;/span&gt; Laptops&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Count&lt;/span&gt; &lt;span style="color:#000066;"&gt;-&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;1&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;do&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      Result&lt;span style="color:#000066;"&gt;[&lt;/span&gt;I&lt;span style="color:#000066;"&gt;]&lt;/span&gt; &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; Laptops&lt;span style="color:#000066;"&gt;[&lt;/span&gt;i&lt;span style="color:#000066;"&gt;]&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;LaptopListReverter &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;procedure&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Field&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;String&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Args&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TListOfObjects&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  obj&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Laptops&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TLaptops&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Laptop&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TLaptop&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  i&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;integer&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Laptops &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TProgrammer&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Laptops&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Laptops&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Clear&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;for&lt;/span&gt; obj &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;in&lt;/span&gt; Args &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;do&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    laptop &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; obj &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;as&lt;/span&gt; TLaptop&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Laptops&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Add&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;TLaptop&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Create&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;laptop&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Model&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; laptop&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Price&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;StringListConverter &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TListOfStrings&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  i&lt;span style="color:#000066;"&gt;,&lt;/span&gt; count&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;integer&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  count &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TStringList&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;count&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="color:#000066;"&gt;SetLength&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Result&lt;span style="color:#000066;"&gt;,&lt;/span&gt; count&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;for&lt;/span&gt; i &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;0&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;to&lt;/span&gt; count &lt;span style="color:#000066;"&gt;-&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;1&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;do&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    Result&lt;span style="color:#000066;"&gt;[&lt;/span&gt;i&lt;span style="color:#000066;"&gt;]&lt;/span&gt; &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TStringList&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;[&lt;/span&gt;i&lt;span style="color:#000066;"&gt;]&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;StringListReverter &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TListOfStrings&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  StrList&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TStringList&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="color:#000066;"&gt;Str&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  StrList &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; TStringList&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Create&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;for&lt;/span&gt; &lt;span style="color:#000066;"&gt;Str&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;in&lt;/span&gt; Data &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;do&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;    StrList&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;Add&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Str&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Result &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; StrList&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;ISODateTimeConverter &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;function&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Field&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  ctx&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TRttiContext&lt;span style="color:#000066;"&gt;;&lt;/span&gt; &lt;span style="color:#000066;"&gt;date&lt;/span&gt; &lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TDateTime&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="color:#000066;"&gt;date&lt;/span&gt; &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; ctx&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetType&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;ClassType&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetField&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Field&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetValue&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;AsType&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  Result &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="color:#000066;"&gt;FormatDateTime&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;'yyyy-mm-dd hh:nn:ss'&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#000066;"&gt;date&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;ISODateTimeReverter &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;procedure&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TObject&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Field&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt; Arg&lt;span style="color:#000066;"&gt;:&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;string&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;var&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  ctx&lt;span style="color:#000066;"&gt;:&lt;/span&gt; TRttiContext&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  datetime &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  &lt;span style="FONT-WEIGHT: bold;color:#000066;" &gt;TDateTime&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;begin&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: bold; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  datetime &lt;span style="color:#000066;"&gt;:&lt;/span&gt;&lt;span style="color:#000066;"&gt;=&lt;/span&gt; EncodeDateTime&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;1&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;4&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;6&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;9&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;      &lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;12&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;15&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#000066;"&gt;StrToInt&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;&lt;span style="color:#000066;"&gt;Copy&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Arg&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;18&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;2&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;,&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;0&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;  ctx&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetType&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;ClassType&lt;/span&gt;&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;GetField&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Field&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;span style="color:#006600;"&gt;SetValue&lt;/span&gt;&lt;span style="color:#000066;"&gt;(&lt;/span&gt;Data&lt;span style="color:#000066;"&gt;,&lt;/span&gt; datetime&lt;span style="color:#000066;"&gt;)&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;li style="FONT-WEIGHT: normal; VERTICAL-ALIGN: top"&gt;&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-BOTTOM: 0px; MARGIN: 0px; FONT: 1em/1.2em monospace; VERTICAL-ALIGN: top; PADDING-TOP: 0px"&gt;&lt;span style="FONT-WEIGHT: bold;color:#000000;" &gt;end&lt;/span&gt;&lt;span style="color:#000066;"&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Last hint…&lt;/strong&gt;&lt;br /&gt;Every serialization/unserialization process can create “warnings”.&lt;br /&gt;Those warnings are collected into the “Warnings” property of the Ser/UnSer Object. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Conclusions&lt;/strong&gt;&lt;br /&gt;In this post I tried to introduce the basics of the new serialization engine in Delphi 2010.&lt;br /&gt;During the next &lt;a href="http://www.itdevcon.it/" target="_blank"&gt;ITDevCon&lt;/a&gt; to be held in Italy next November 11.12, I’ll have a talk in which I will extensively talk about serialization and RTTI.&lt;br /&gt;All interested smart developers are invited &lt;/p&gt;&lt;br /&gt;&lt;p&gt;ITALIAN P.S.&lt;br /&gt;Se qualche programmatore italiano volesse avere la versione in italiano di questo post può lasciare un commento e vedrò di accontentarlo &lt;/p&gt;&lt;br /&gt;&lt;p&gt;You can find the DUnit project &lt;a href="http://www.danieleteti.it/wp-content/uploads/2009/09/marshall_unmarshall_in_d2010.zip"&gt;Source Code&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-8740960246154473638?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/8740960246154473638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=8740960246154473638' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8740960246154473638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8740960246154473638'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/09/custom-marshallingunmarshalling-in.html' title='Custom Marshalling/UnMarshalling in Delphi 2010'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-5187861977872653768</id><published>2009-09-02T18:14:00.000-07:00</published><updated>2009-09-02T18:15:12.422-07:00</updated><title type='text'>What’s new in the Delphi and C++Builder Debugger</title><content type='html'>Want to find out? Be sure to sign up for CodeRage and check out my session. I just put the final touches on my presentation today. It’s nearly 35 minutes of non-stop demos showing many of the new debugger features in Delphi 2010 and C++Builder 2010. Several of the features have been blogged about already (by myself and others), but there are many things shown in the session that I haven’t seen mentioned yet, plus it’s always useful to see some features in action rather than just reading about them.&lt;br /&gt;&lt;br /&gt;My session will debut on Tuesday and then be repeated on Friday.&lt;br /&gt;&lt;br /&gt;Looks like there are plenty of great sessions throughout the week.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-5187861977872653768?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/5187861977872653768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=5187861977872653768' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/5187861977872653768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/5187861977872653768'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/09/whats-new-in-delphi-and-cbuilder.html' title='What’s new in the Delphi and C++Builder Debugger'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-6791654170852906340</id><published>2009-09-02T18:12:00.001-07:00</published><updated>2009-09-02T18:12:38.850-07:00</updated><title type='text'>Dynamically compiling code with Delphi Prism</title><content type='html'>Delphi Prism and the .NET Framework are both extremely powerful tools and bring a lot of flexibility that Delphi for Win32 cannot necessarily provide, particularly when it comes to reflection and code generation. I recently started a project where I wanted to be able to compile a string with Delphi Prism code into an assembly without hacking my way around with the Delphi Prism command line compiler. This could be used to potentially create a Delphi Prism Snippet Compiler similar to the .NET Snippet Compiler from Jeff Key.&lt;br /&gt;&lt;br /&gt;It is my intention that this post should introduce you to the process of dynamically compiling code and that the next part will hopefully be an introduction to the process of dynamically generating and compiling code using the .NET CodeDom.&lt;br /&gt;&lt;br /&gt;To begin with, create a New Console Application in Delphi Prism and Add a Reference to the RemObjects.Oxygene.CodeModel assembly. For my installation, this was found in the Bin directory of the Delphi Prism program files directory.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-6791654170852906340?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/6791654170852906340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=6791654170852906340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6791654170852906340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6791654170852906340'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/09/dynamically-compiling-code-with-delphi.html' title='Dynamically compiling code with Delphi Prism'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-538616206283786523</id><published>2009-08-10T16:22:00.000-07:00</published><updated>2009-08-10T16:23:07.933-07:00</updated><title type='text'>Lazarus article on Linux Journal</title><content type='html'>I finally got around to browse the Linux Journal Magazine (September 2009) that this month features cross platform development, and noticed the word Lazarus at the top of the cover page. Yes, it is an article about the Delphi like IDE. The article is written by Mattias Gaertner, a member of the Lazarus project.&lt;br /&gt;&lt;br /&gt;The article is an overview of Lazarus/FPC and cross platform development. It explores Lazarus/FPC cross platform capabilities and dices into some of the IDE features. The cool aspect of this article is that is being presented in a non Delphi venue that is dedicating it’s pages to cross platform development. This exposing a Pascal IDE to a “new” audience.&lt;br /&gt;&lt;br /&gt;Most certainly, Lazarus brings to the table cross platform development in a way that is more native to your target than .NET et al. Lazarus produces native code for Windows, Macs and Linux. I can only imagine where we could have been if Borland would have gotten Kilyx right… In any case, I have played with Lazarus and FPC for the past couple of years and I am to a point that I am willing to start a small cross platform project solely using Lazarus and FPC.&lt;br /&gt;&lt;br /&gt;Here is a link to the article – unfortunately one has to be a subscriber to read. If you are not a subscriber, you can go to your local newsstand or book store and read the article.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-538616206283786523?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/538616206283786523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=538616206283786523' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/538616206283786523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/538616206283786523'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/08/lazarus-article-on-linux-journal.html' title='Lazarus article on Linux Journal'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-8227607250068830573</id><published>2009-08-10T16:19:00.000-07:00</published><updated>2009-08-10T16:21:36.571-07:00</updated><title type='text'>RAD Studio 2010: First Preview</title><content type='html'>It seems that Embarcadero sat in stone the release date of &lt;strong&gt;RAD Studio 2010&lt;/strong&gt;. And it’s closer than others might expect: 24/25 August (depends on what part of the Globe you’re on). Also, it seems that IDE and the Debugger (as is shown in the video bellow)… were significantly improved in this release. I do think that after a long time these areas receive improvements, thing which is pretty encouraging. But we’ll see how each feature will pass the ‘community test’.&lt;br /&gt;&lt;br /&gt;See for yourself at:&lt;br /&gt;&lt;br /&gt;http://www.embarcadero.com/rad-studio-2010/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-8227607250068830573?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/8227607250068830573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=8227607250068830573' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8227607250068830573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8227607250068830573'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/08/rad-studio-2010-first-preview.html' title='RAD Studio 2010: First Preview'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-8583404027378220233</id><published>2009-08-10T16:16:00.000-07:00</published><updated>2009-08-10T16:19:22.222-07:00</updated><title type='text'>RAD Studio 2010: ToolsAPI enhancements</title><content type='html'>&lt;p&gt;With all the news filtering out about new IDE features and enhancements in RAD Studio 2010, I wanted to provide a quick "highlight" list of new things in the ToolsAPI, several of which correspond directly to new features.  It should give you an idea of new things you can accomplish via IDE addins.  Each bullet item also indicates the new or enhanced interfaces associated with the new feature.&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Support for creating dockable views in the IDE.  This was previously achievable using the technique described by Allen in this article: http://edn.embarcadero.com/article/21114.  Now, however, there is an official ToolsAPI way to do this.  The TStrings Debugger Visualizer source can serve as one example of using the new interface. Pertinent interfaces: &lt;strong&gt;INTACustomDockableForm&lt;/strong&gt; and &lt;strong&gt;INTAServices&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Support for plugging in addtional views in the editor space.  There is support for creating new top-level editor tabs (similar to the debugger’s CPU View or Modules view and the new C++ Class Explorer) as well as creating additional bottom-level tabs (similar to the "Code", "Design" and "History" tabs).  I have a very simple example that creates both types of tabs.  I’ll try to get it cleaned up and posted to CodeCentral soon. Pertinent interfaces: &lt;strong&gt;INTACustomEditorView&lt;/strong&gt;, &lt;strong&gt;INTACustomEditorViewState&lt;/strong&gt;, &lt;strong&gt;INTACustomEditorViewStatusPanel&lt;/strong&gt;, &lt;strong&gt;INTACustomEditorSubView&lt;/strong&gt;, and &lt;strong&gt;IOTAEditorViewServices&lt;/strong&gt; and &lt;strong&gt;INTAEditorServices&lt;/strong&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Support for IDE Insight. Stay tuned to Mark’s blogs for more information here. Pertinent interfaces: &lt;strong&gt;INTAIDEInsightItem&lt;/strong&gt;, &lt;strong&gt;IOTAIDEInsightCategory&lt;/strong&gt;, &lt;strong&gt;IOTAIDEInsightNotifier&lt;/strong&gt;, and &lt;strong&gt;IOTAIDEInsghtServices&lt;/strong&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There is enhanced support for adding menu items into the Project Manager local menu.  The support provides more flexibility in terms of when and where your menu items appear. Pertinent interfaces: &lt;strong&gt;IOTAProjectMenuItemCreatorNotifier&lt;/strong&gt;, &lt;strong&gt;IOTAProjectManager&lt;/strong&gt;, &lt;strong&gt;IOTAProjectMenuContext&lt;/strong&gt;, and &lt;strong&gt;IOTAProjectManagerMenu&lt;/strong&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;IOTAProject has been enhanced to provide more complete information about which files make up a project, as well as providing better information regarding file renames and deletions. Pertinent interface: &lt;strong&gt;IOTAProject&lt;/strong&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Support for wrtiting and registering debugger visualizers.  There are sample visualizers that ship with RAD Studio 2010 that demonstrate how to use these interfaces.  You can find the source in the Source\Win32\Visualizers directory under the Rad Studio 2010 installation directory. Pertinent interfaces: &lt;strong&gt;IOTADebuggerVisualizer&lt;/strong&gt;, &lt;strong&gt;IOTADebuggerVisualizerValueReplacer&lt;/strong&gt;, &lt;strong&gt;IOTADebuggerVisualizerExternalViewer&lt;/strong&gt;, &lt;strong&gt;IOTADebuggerVisualizerExternalViewerUpdater&lt;/strong&gt;, and &lt;strong&gt;IOTADebuggerServices&lt;/strong&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Several debugger interfaces have been enhanced to support new features in the debugger (thread-specific breakpoints, freezing/thawing threads), as well as providing access to other information from the debugger (thread names, asking whether a particular type descends from another type, better access to module breakpoints).  Pertinent interfaces: &lt;strong&gt;IOTAThread&lt;/strong&gt;, &lt;strong&gt;IOTABreakpoint&lt;/strong&gt;, and &lt;strong&gt;IOTADebuggerServices&lt;/strong&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Support for build system notifications (CompileStarted/CompileFinished events for Projects and ProjectGroups) as well as other build system services. Pertinent interfaces: &lt;strong&gt;IOTACompileNotifier&lt;/strong&gt; and &lt;strong&gt;IOTACompileServices&lt;/strong&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;New support for adding version control systems to the IDE. Pertinent interfaces: &lt;strong&gt;IOTAVersionControlNotifier&lt;/strong&gt; and &lt;strong&gt;IOTAVersionControlServices&lt;/strong&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The IOTAElideActions interface (code folding support) has been enhanced to allow more code folding actions to be accessed via the ToolsAPI. Pertinent interface: &lt;strong&gt;IOTAElideActions&lt;/strong&gt;.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;As always, the source code comments in the ToolsAPI.pas unit is the place to look for information for most of these ToolsAPI additions.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;And just because I’m sure someone will ask, there is still no "official" documentation of the ToolsAPI, though I’ve had several inquiries from the documentation team about reviving the old (circa Delphi 7) ToolsAPI documentation.  So it wouldn’t surprise me to see the official documentation return in one form or another sometime in the future.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-8583404027378220233?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/8583404027378220233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=8583404027378220233' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8583404027378220233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8583404027378220233'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/08/rad-studio-2010-toolsapi-enhancements.html' title='RAD Studio 2010: ToolsAPI enhancements'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-7981210057903192447</id><published>2009-07-25T16:48:00.000-07:00</published><updated>2009-07-25T16:52:06.451-07:00</updated><title type='text'>TxdsControlsStates V1.1</title><content type='html'>&lt;span style="color:#3366ff;"&gt;TxdsControlsStates&lt;/span&gt; is Delphi Component to store states of controls and components on your form to recall later during run-time.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;TxdsControlsStates&lt;/span&gt; allows you to eliminate that series of assignments and replace it with single method call to&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;TxdsControlsStates.RestoreState(StateName:String);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The set of Component Properties and States are defined during design-time in property editor.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.xdenser.com/downloads/xds_states.zip" target="blank"&gt;Download here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-7981210057903192447?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/7981210057903192447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=7981210057903192447' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/7981210057903192447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/7981210057903192447'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/07/txdscontrolsstates-v11.html' title='TxdsControlsStates V1.1'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-7762670649124061717</id><published>2009-07-25T16:46:00.000-07:00</published><updated>2009-07-25T16:47:48.146-07:00</updated><title type='text'>ATFileNotification V1.1.4</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_e42QR63MTVU/SmuZmCpg2lI/AAAAAAAAADs/m5sDH0hV9qA/s1600-h/ATFileNotification_Demo.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5362548660139776594" style="FLOAT: right; MARGIN: 0px 0px 10px 10px; WIDTH: 359px; CURSOR: hand; HEIGHT: 312px" alt="" src="http://2.bp.blogspot.com/_e42QR63MTVU/SmuZmCpg2lI/AAAAAAAAADs/m5sDH0hV9qA/s400/ATFileNotification_Demo.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;ATFileNotification&lt;/strong&gt; is a non-visual component, which allows to watch for files/directories changes and to fire an event when change occurs.&lt;br /&gt;It is improved version of fisFileNotification component. Improvements are:&lt;br /&gt;&lt;br /&gt;Component made Unicode compatible&lt;br /&gt;FileName property added: you can watch for changes in a single file&lt;br /&gt;Attempt to make component thread-safe (need feedback about it) &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-7762670649124061717?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/7762670649124061717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=7762670649124061717' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/7762670649124061717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/7762670649124061717'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/07/atfilenotification-v114.html' title='ATFileNotification V1.1.4'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_e42QR63MTVU/SmuZmCpg2lI/AAAAAAAAADs/m5sDH0hV9qA/s72-c/ATFileNotification_Demo.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-1880462319705943793</id><published>2009-07-25T16:42:00.000-07:00</published><updated>2009-07-25T16:44:27.572-07:00</updated><title type='text'>AutoCorrect Components v1.0</title><content type='html'>&lt;strong&gt;What does the code do exactly?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Implements for TCustomEdit and TCustomCombo descendents a large sub-set of the AutoCorrect functionality had by ‘proper’ word processors. Specifically, the following is implemented:&lt;br /&gt;&lt;br /&gt;User-defined ‘replace text as you type’ entries, including formatted ones if the active control is a rich edit.&lt;br /&gt;TWo INitial CApitals correction, with an exception list that is automatically added to when the user immediately undoes a correction.&lt;br /&gt;Conversion of ’straight’ quotes into ‘curly’ (‘smart’) quotes.&lt;br /&gt;Conversion of hyphens to dashes: two hyphens in a row (–) turn into an em-dash, a hyphen with a space either side ( – ) becomes an en-dash with a space either side.&lt;br /&gt;Conversion of 1/2 to ½, 1/4 to ¼, and 3/4 to ¾.&lt;br /&gt;Auto-indentation for rich edit controls — in other words, allows the user to set the active paragraph’s left- and first-indent properties by tabbing and backspacing.&lt;br /&gt;How does it work?&lt;br /&gt;&lt;br /&gt;In essence, the code works by trapping the KeyPress method (OnKeyPress event) of the active control, testing for a trigger key that will lead to correction testing proper kicking in. The initial trapping, however, is ‘manual’ in the sense that the TAutoCorrectEngine component does not actively ‘seek out’ key press events — it needs to be told about them.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What’s the quickest way to see it in action?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Download the code from here (EDN registration required — it’s free and relatively easy to do though), open up the ‘AutoCorrect demo and design-time package’ project group, and run the last project listed (AutoCorrectDemo.dpr). Since the TAutoCorrectEngine component is created at runtime for the demo, no installation is required.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How do I use the code myself?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Firstly, compile and install the design-time package, dclCCRAutoCorrect.dpk. This should lead to five new components being added to the component palette: TAutoCorrectEngine, TComboBoxWithAutoCorrect, TEditWithAutoCorrect, TMemoWithAutoCorrect and TRichEditWithAutoCorrect.&lt;br /&gt;Ensure CCR.AutoCorrect.dcu and CCR.AutoCorrect.Consts.dcu end up somewhere in your library paths — the easiest way to do this is to add the component’s directory as a library path itself. In Delphi 2007, you do this by going to ToolsOptions, Environment Options -&gt; Delphi Options -&gt; Library – Win32, and clicking on the ellipsis button for ‘Library path’.&lt;br /&gt;Create a new VCL forms application and add a TAutoCorrectEngine component to the main form; double click the component to add some custom ‘replace-as-you-type’ entries.&lt;br /&gt;Add one or more TxxxWithAutoCorrect controls to the form, and assign their AutoCorrectEngine property to the TAutoCorrectEngine component.&lt;br /&gt;Compile and run.&lt;br /&gt;But I don’t want to use your custom descendants of TEdit, TRichEdit, etc.!&lt;br /&gt;&lt;br /&gt;No problem — you’ll just have to do a bit of manual work, calling as appropriate the KeyDownOccurred, KeyPressOccurred and UndoOccurred methods of the TAutoCorrectEngine component. The last of these is best done by defining an undo action (i.e., a TAction with Ctrl+Z as its shortcut), UndoOccurred being called immediately after the undo operation is performed. As for the other two, you can either handle the OnKeyXXX events of the controls themselves or (if you set KeyPreview to True) the parent form — in the second case, pass ActiveControl as the first parameter to KeyXXXOccurred. See the main demo for an example of all this — the process is simpler than it may sound.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The small print&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Target Delphi versions: separate versions for Delphi 7 on the one hand, and Delphi 2006 or greater on the other, are included in the ZIP — both versions’ functionality and implementation are almost identical however.&lt;br /&gt;&lt;br /&gt;Turbo Delphi Explorer compatibility: since you don’t need to install TAutoCorrectEngine to actually use it, and adding custom entries at runtime is pretty easy. Check out the main demo, which doesn’t use a design-time instance of the component and so can be open and run from inside the Turbo Delphi IDE.&lt;br /&gt;&lt;br /&gt;Rich edit bugs: note that the TRichEditWithAutoCorrect class works around bugs in the underlying DLL the VCL’s TCustomRichEdit wraps. Specifically, v1 of the DLL (used until Delphi 2009) uncurls smart quotes when they are streamed or pasted in, and v1 to v3 of the DLL don’t load en- and em-dashes correctly, loading them as hyphens.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-1880462319705943793?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/1880462319705943793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=1880462319705943793' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/1880462319705943793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/1880462319705943793'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/07/autocorrect-components-v10.html' title='AutoCorrect Components v1.0'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-6667845003779472105</id><published>2009-05-23T05:29:00.000-07:00</published><updated>2009-05-23T05:30:04.498-07:00</updated><title type='text'>We have huge amounts of memory and concurrent programming is an exception</title><content type='html'>It's quite amazing to hear Anders advocating bloat in a world where most of the world still has bad internet connections and hate large downloads, mobile phones prefer 1MB applications over 10MB apps, where RAM can be a bottleneck, where battery life is always too short and where many large organizations struggle with bad performance.&lt;br /&gt;&lt;br /&gt;I recently had the chance to see the standard configuration for virtual servers in a large organization. In order to improve network traffic, the standard network adapter is limited to 10Mbit/sec.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-6667845003779472105?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/6667845003779472105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=6667845003779472105' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6667845003779472105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6667845003779472105'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/we-have-huge-amounts-of-memory-and.html' title='We have huge amounts of memory and concurrent programming is an exception'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-5738400702386235718</id><published>2009-05-23T05:20:00.000-07:00</published><updated>2009-05-23T05:22:48.801-07:00</updated><title type='text'>Add-in Express 2009 for Office and VCL</title><content type='html'>Visual designers and components of Add-in Express in combination with a perfect Delphi compiler provide you with the best platform for Office development. Add-in Express makes it equally easy to build toolbars, menus and sub-menus for Microsoft Office 2000 – 2003, customize the Office 2007 Ribbon using the Office 2007 Ribbon designer as well as to create custom static and contextual ribbon tabs, task panes, navigation pane and reading pane, Office Menu and Quick Access Toolbar.&lt;br /&gt;&lt;br /&gt;Add-in Express for Delphi implements all interfaces and techniques required by supported technologies, you write functional code only. Another key benefit of Add-in Express is version neutrality – you write the plug-in code once and get a secure Microsoft Office extension that works for all applications and versions.&lt;br /&gt;&lt;br /&gt;Plug-in types: COM add-ins, smart tags, real-time data servers&lt;br /&gt;Office versions: Office 2000, 2002, 2003, 2007&lt;br /&gt;Applications: Outlook, Word, Excel, PowerPoint, Access, Publisher, Project, MapPoint, InfoPath, Visio&lt;br /&gt;IDEs: Delphi 5, 6, 7, 2006, 2007, 2009&lt;br /&gt;Windows Vista ready&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-5738400702386235718?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/5738400702386235718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=5738400702386235718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/5738400702386235718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/5738400702386235718'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/add-in-express-2009-for-office-and-vcl.html' title='Add-in Express 2009 for Office and VCL'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-6657262008939258938</id><published>2009-05-20T05:58:00.000-07:00</published><updated>2009-05-20T06:00:41.612-07:00</updated><title type='text'>DataSnap the fastest multi-tier development</title><content type='html'>&lt;p&gt;The new approach was introduced with RAD Studio 2009 (including Delphi &amp;amp; C++Builder) and was based on a NON-COM/DCOM approach.&lt;span style="font-size:+0;"&gt; &lt;/span&gt;The new approach used JSON (JavaScript Object Notation) &lt;a href="http://www.json.org/"&gt;http://www.json.org/&lt;/a&gt; housed on a TCP/IP message layer wrapped in the DataSnap technology.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;What makes this approach great is that it is simple to implement:&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Create a DataSnap Server&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Create a VCL Form application&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Add the 3 DataSnap Server components&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Connect the Server components&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Add a ServerModule (this is where the developer exposes business logic and data from the backend storage)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Connect the ServerModule to the Server components for the wire protocol and transfer of information&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Create a client (generic client)&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Create a VCL form application, Web application, ASP.NET (Prism) application&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Drop a TSQLConnection component&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Set the connection properties (3 in all)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Right-mouse click on the TSQLConnection and generate Client Proxy&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Use Proxy to connect to the remote server and call logic at will&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Expose information on client&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Done&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p&gt;This is a nine minute demo with explanations, 5 without… at best and IMO, it is the fastest multi-tier approach out there compared to JEE, CORBA, RMI, COM/DCOM, or plain old RPC.&lt;span style="font-size:+0;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;This approach isolates the database layer to the middle tier; there is no reason for the client to know that you are even connecting to a backend database.&lt;span style="font-size:+0;"&gt; &lt;/span&gt;The exposure of business logic is as simple as writing public functions and the building of the actual server is a form and three (3) components.&lt;span style="font-size:+0;"&gt; &lt;/span&gt;There are no 7 helper files like with Java’s EJB, or 3 helper files with CORBA, or IDL/RIDL with COM/DCOM, and you surely don’t have to define each side of the communication like with RPC.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So there must be a downside to the technology… there always is… isn’t there?&lt;span style="font-size:+0;"&gt; &lt;/span&gt;As far as I can see today, there are no advert downsides.&lt;span style="font-size:+0;"&gt; &lt;/span&gt;There is no royalty to use it, it is simple to understand, it helps to reduce database connections, it very fast, it scales well, and it uses open protocols.&lt;span style="font-size:+0;"&gt; &lt;/span&gt;What is not to like?&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Now could there be more features added or could it even become simpler to use in future releases of the feature/functionality?&lt;span style="font-size:+0;"&gt; &lt;/span&gt;Sure, but then again, if you are a diehard Delphi/C++Builder developer you already know that we don’t rest on the past implementation we are always trying to push the technology to the next level.&lt;span style="font-size:+0;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;This leads to the next item; I’m going to be publishing the roadmap for RAD Studio very soon and also an audio recording of the presentation.&lt;span style="font-size:+0;"&gt; &lt;/span&gt;There will be more details about where the technology of DataSnap is going in the future and should give every Delphi/C++Builder/Prism developer some great piece of mind to see the investment being put into our beloved product with Embarcadero!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-6657262008939258938?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/6657262008939258938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=6657262008939258938' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6657262008939258938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6657262008939258938'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/datasnap-fastest-multi-tier-development.html' title='DataSnap the fastest multi-tier development'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-4566337148452631344</id><published>2009-05-20T05:52:00.000-07:00</published><updated>2009-05-20T05:56:15.728-07:00</updated><title type='text'>HelpNDoc let's you generate help files in various formats from a single source</title><content type='html'>&lt;li&gt;&lt;strong&gt;CHM&lt;/strong&gt;: Compiled Microsoft Windows HTML Help;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;HTML&lt;/strong&gt;: Complete web help optimized for easy online browsing and search engines;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;DOC&lt;/strong&gt;: Complete help documentation as a Microsoft Word document or RTF file;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;PDF&lt;/strong&gt;: Standard Adobe portable document format documentation for easy sharing and printing;&lt;/li&gt;&lt;br /&gt;&lt;p&gt;HelpNDoc includes a complete &lt;abbr title="What you see is what you get"&gt;WYSIWYG&lt;/abbr&gt; editor with advanced formatting and layout capabilities. &lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Advanced &lt;strong&gt;paragraph formatting&lt;/strong&gt;: alignment, indentation, line spacing, tabs and text flow;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Advanced &lt;strong&gt;font customization&lt;/strong&gt;: character spacing, offset, scaling, superscripts and subscripts;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Extensive &lt;strong&gt;image format&lt;/strong&gt; support: JPG, PNG, GIF, BMP, ICO, EMF, WMF;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Advanced &lt;strong&gt;table support&lt;/strong&gt;: cell padding and spacing, alignment, customizable borders and fills;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Complete &lt;strong&gt;live spell checker&lt;/strong&gt; with custom dictionaries and automatic corrections;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;li&gt;Table of content editor with &lt;strong&gt;instant reorganization&lt;/strong&gt; and customization;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Extremely fast topic creation, deletion and customization;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Advanced &lt;strong&gt;keywords editor&lt;/strong&gt;: easily attach keywords with topics, categorize and manage them;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Automatic Topic ID and Context number generation;&lt;/li&gt;&lt;br /&gt;&lt;p&gt;Writing and integrating help files has never been easier thanks to HelpNDoc's advanced functionalities. &lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Live external &lt;strong&gt;document import&lt;/strong&gt;: the document will be imported when the help file is generated;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Project or user defined &lt;strong&gt;variables&lt;/strong&gt;: the variable will be replaced when the help file is generated;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Project-wide efficient find and replace tool: find a sentence and &lt;strong&gt;replace it by a variable&lt;/strong&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Multiple language &lt;strong&gt;code generation&lt;/strong&gt;: C/C++ headers, Delphi units, Visual Basic and Fortran modules to ease help file interaction;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Extensive &lt;strong&gt;command line support&lt;/strong&gt; to pilot HelpNDoc from an external application, an automated processing or a batch script;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-4566337148452631344?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/4566337148452631344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=4566337148452631344' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4566337148452631344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4566337148452631344'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/helpndoc-lets-you-generate-help-files.html' title='HelpNDoc let&apos;s you generate help files in various formats from a single source'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-4043794187520613088</id><published>2009-05-20T05:45:00.000-07:00</published><updated>2009-05-20T05:48:22.135-07:00</updated><title type='text'>Delphi Prism Web Services and SOAP Security</title><content type='html'>In this article, I'll demonstrate how to use SOAP Headers as security technique for ASP.NET Web Service projects using Delphi Prism (extending the example from last month by adding a security layer to it).&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:Comic Sans MS;font-size:130%;"&gt;&lt;b&gt;SOAP Headers&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In order to work with SOAP Headers in an ASP.NET Web Service, we have to add System.Web.Services.Protocols to the uses clause, and define a new class derived from the SoapHeader class found in the aforementioned namespace.&lt;br /&gt;The new class can be called anything, so I've decided to call it TCredentials (I know that in the .NET Framework you're not supposed to prefix everything with a "T", but since I'm a proud Delphi developer, I always use a T prefix for my types).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It must be a public class, since we need to export it so any client importing our ASP.NET web service can also know about it.&lt;br /&gt;Adding a Username and Password field to the TCredentials class, this could lead to the following definition.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;  &lt;b&gt;type&lt;/b&gt;&lt;br /&gt;    TCredentials = &lt;b&gt;public class&lt;/b&gt;(System.Web.Services.Protocols.SoapHeader)&lt;br /&gt;    &lt;b&gt;public&lt;/b&gt;&lt;br /&gt;      Username: String;&lt;br /&gt;      Password: String;&lt;br /&gt;    &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;With this class definition in mind, we can add a public field (for example called token) to the public class Service, as well as a private method (for example called CheckCredentials) to check if the credentials have been received and contain the correct username/password information.&lt;br /&gt;This leads to the following modification of the Service class:&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;    Service = &lt;b&gt;public class&lt;/b&gt;(System.Web.Services.WebService)&lt;br /&gt;    &lt;b&gt;public&lt;br /&gt;      var&lt;/b&gt;&lt;br /&gt;        token: TCredentials;&lt;br /&gt;&lt;br /&gt;    &lt;b&gt;private&lt;br /&gt;      method&lt;/b&gt; CheckCredentials: Boolean;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;In order to specify that the token has to be used for certain web method (from the original set), we have to add the attribute SoapHeader to the web method, specifying the token as well as the direction in which the token is assigned (in our case only on input, so only the web service client will be writing information in the token, and the Service web service "engine" can check the token for valid credentials by looking at its value).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Using the example from &lt;a href="http://www.blogger.com/examinB1.htm"&gt;last month&lt;/a&gt;, we can modify some of the web methods as follows:&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;    &lt;b&gt;public&lt;/b&gt;&lt;br /&gt;      [WebMethod(EnableSession := true)]&lt;br /&gt;      [SoapHeader('token', Direction := SoapHeaderDirection.&amp;amp;In)]&lt;br /&gt;      &lt;b&gt;method&lt;/b&gt; Remember(&lt;b&gt;const&lt;/b&gt; Name,Value: String);&lt;br /&gt;&lt;br /&gt;      [WebMethod(EnableSession := true)]&lt;br /&gt;      [SoapHeader('token', Direction := SoapHeaderDirection.&amp;amp;In)]&lt;br /&gt;      &lt;b&gt;method&lt;/b&gt; Recall(&lt;b&gt;const&lt;/b&gt; Name: String): String;&lt;br /&gt;&lt;br /&gt;      [WebMethod(EnableSession := true)]&lt;br /&gt;      &lt;b&gt;method&lt;/b&gt; Forget(&lt;b&gt;const&lt;/b&gt; Name: String);&lt;br /&gt;&lt;br /&gt;      [WebMethod(EnableSession := true)]&lt;br /&gt;      &lt;b&gt;method&lt;/b&gt; Amnesia; &lt;span class="comment"&gt;// forget all&lt;/span&gt;&lt;br /&gt;    &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Note that I only added the SoapHeader attribute to the Remember and Recall web methods, and not to the Forget or Amnesia methods.&lt;br /&gt;In other words: you are free to forget, but in order to remember or recall something, you need security clearance.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Inside that Remember and Recall methods, we will have to call the CheckCredentials method before doing their actual work, in order to verify the value of the token.&lt;br /&gt;Which leads us to the implementation of CheckCredentials, which is shown below (using a hard-coded check for the values of the Username and Password properties of the token - you should obviously implement a stronger check here!).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note that apart from returning False is the Username and Password are incorrect, we can also raise an exception, for example if the token is not found in the SOAP header (which might happen if the web service is consumed and used by web service client applications who do not add the token to the SOAP header in the first place).&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;  &lt;b&gt;method&lt;/b&gt; Service.CheckCredentials: Boolean;&lt;br /&gt;  &lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;    Result := False;&lt;br /&gt;    &lt;b&gt;if not&lt;/b&gt; Assigned(token) &lt;b&gt;then&lt;br /&gt;        raise&lt;/b&gt; ApplicationException.Create('No token in SOAP Header!');&lt;br /&gt;&lt;br /&gt;    &lt;b&gt;if&lt;/b&gt; (token.Username.ToLower = 'bob') &lt;b&gt;and&lt;/b&gt;&lt;br /&gt;       (token.Password.ToLower = 'swart') &lt;b&gt;then&lt;/b&gt; Result := True&lt;br /&gt;  &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The implementation of Remember and Recall can simple be extended by calling the CheckCredentials method before doing anything:&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;  &lt;b&gt;method&lt;/b&gt; Service.Remember(&lt;b&gt;const&lt;/b&gt; Name,Value: String);&lt;br /&gt;  &lt;b&gt;begin&lt;br /&gt;    if&lt;/b&gt; CheckCredentials &lt;b&gt;then&lt;/b&gt;&lt;br /&gt;      Session[Name] := Value&lt;br /&gt;  &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;br /&gt;  &lt;b&gt;method&lt;/b&gt; Service.Recall(&lt;b&gt;const&lt;/b&gt; Name: String): String;&lt;br /&gt;  &lt;b&gt;begin&lt;br /&gt;    if&lt;/b&gt; CheckCredentials &lt;b&gt;then&lt;br /&gt;      if&lt;/b&gt; Assigned(Session[Name]) &lt;b&gt;then&lt;/b&gt;&lt;br /&gt;        Result := Session[Name].ToString&lt;br /&gt;      &lt;b&gt;else&lt;/b&gt; Result := ''&lt;br /&gt;  &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Note that Forget and Amnesia remain unchanged, since you are always allowed to forget:&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;  &lt;b&gt;method&lt;/b&gt; Service.Forget(&lt;b&gt;const&lt;/b&gt; Name: String);&lt;br /&gt;  &lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;    Session.Remove(Name) &lt;span class="comment"&gt;// always allowed&lt;/span&gt;&lt;br /&gt;  &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;br /&gt;  &lt;b&gt;method&lt;/b&gt; Service.Amnesia;&lt;br /&gt;  &lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;    Session.Abandon &lt;span class="comment"&gt;// always allowed&lt;/span&gt;&lt;br /&gt;  &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Before deploying and consuming this new secure web service, there's one thing to keep in mind about using SOAP Headers: the contents are sent in plain text over the network.&lt;br /&gt;So passing a username and password inside a SOAP Header is adding authorization capabilities, but still lacks a little security.&lt;br /&gt;For that reason, I always recommend to use SOAP Headers in combination with HTTPS and SSL.&lt;br /&gt;That way, the traffic between the web service and client is encrypted, and nobody else should be able to decypher the information sent by the client to the server (since it's encrypted with the public key from the server, and can only be decrypted by the private key of the server, so anyone sniffing the network only gets an encrypted package).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Implementing HTTPS and SSL requires two things: first, you should purchase a certificate and install it on your web server (or ask your provider if a certificate is already available for use by your web service), and second, all URLs that are used to communicate with the web service should use https:// and not http://.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For this example, I give you the option of exploring the difference, so I've deployed the secure web service on two different web servers: one with HTTPS and one without.&lt;br /&gt;On one server, you can access the web service via &lt;a href="http://www.bobswart.net/MyWebService/Service.asmx"&gt;http://www.bobswart.net/MyWebService/Service.asmx&lt;/a&gt; and on the other (secure) web server you have to use HTTPS and the URL &lt;a href="https://www.bobswart.nl/MyWebService/Service.asmx"&gt;https://www.bobswart.nl/MyWebService/Service.asmx&lt;/a&gt; instead.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Both will work the same (the MyWebService.dll code behind assembly is exactly the same on both machines), but one connection is more secure than the other, which is important when using SOAP Headers.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-4043794187520613088?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/4043794187520613088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=4043794187520613088' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4043794187520613088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4043794187520613088'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/delphi-prism-web-services-and-soap.html' title='Delphi Prism Web Services and SOAP Security'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-4379989604110250978</id><published>2009-05-13T19:41:00.000-07:00</published><updated>2009-05-13T19:42:52.327-07:00</updated><title type='text'>Move TPageControl's Tabs Using Drag and Drop in Delphi Applications</title><content type='html'>&lt;p&gt;TPageControl is a set of pages used to make a multiple page dialog box. Why not enable your users to rearrange tabs in a TPageControl component at run-time using drag and drop...&lt;br /&gt;Drop a TPageControl on a form, add several (tab) pages and handle the MouseDown, DragDrop and DragOver events of the TPageControl (PageControl1) component &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Why not enable your users to rearrange tabs in a TPageControl component at run time using drag and drop...&lt;br /&gt;Drop a TPageControl on a form, add several (tab) pages and handle the MouseDown, DragDrop and DragOver events of the TPageControl (PageControl1) component. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;procedure TMainForm.PageControl1MouseDown(Sender: TObject;&lt;br /&gt;   Button: TMouseButton; Shift: TShiftState; X, Y: Integer) ;&lt;br /&gt;begin&lt;br /&gt;   PageControl1.BeginDrag(False) ;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TMainForm.PageControl1DragDrop(Sender, Source: TObject; X,&lt;br /&gt;   Y: Integer) ;&lt;br /&gt;const&lt;br /&gt;   TCM_GETITEMRECT = $130A;&lt;br /&gt;var&lt;br /&gt;   TabRect: TRect;&lt;br /&gt;   j: Integer;&lt;br /&gt;begin&lt;br /&gt;   if (Sender is TPageControl) then&lt;br /&gt;   for j := 0 to PageControl1.PageCount - 1 do&lt;br /&gt;   begin&lt;br /&gt;     PageControl1.Perform(TCM_GETITEMRECT, j, LParam(@TabRect)) ;&lt;br /&gt;     if PtInRect(TabRect, Point(X, Y)) then&lt;br /&gt;     begin&lt;br /&gt;       if PageControl1.ActivePage.PageIndex &amp;lt;&amp;gt; j then&lt;br /&gt;         PageControl1.ActivePage.PageIndex := j;&lt;br /&gt;       Exit;&lt;br /&gt;     end;&lt;br /&gt;   end;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TMainForm.PageControl1DragOver(Sender, Source: TObject; X,&lt;br /&gt;   Y: Integer; State: TDragState; var Accept: Boolean) ;&lt;br /&gt;begin&lt;br /&gt;   if (Sender is TPageControl) then Accept := True;&lt;br /&gt;end;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-4379989604110250978?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/4379989604110250978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=4379989604110250978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4379989604110250978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4379989604110250978'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/move-tpagecontrols-tabs-using-drag-and.html' title='Move TPageControl&apos;s Tabs Using Drag and Drop in Delphi Applications'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-6632542319648547411</id><published>2009-05-12T19:53:00.001-07:00</published><updated>2009-05-12T19:53:54.046-07:00</updated><title type='text'>What is an Access Violation</title><content type='html'>Every computer program uses memory for running (*). Memory is consumed by every variable in your program. It can be form, component, object, array, record, string or simple Integer. Memory can be allocated automatically for certain types of variables (such as Integer or static arrays), the other types require manual control of memory (for example, dynamic arrays). Essentially, from the point of operating system, each variable is characterized by its address (i.e. - location) and size.&lt;br /&gt;&lt;br /&gt;Roughly speaking, program uses 3 “types” of memory: area for global variables, the stack and the heap.&lt;br /&gt;Memory for global variables is allocated by OS loader when executable module is loading and it is freed when module is unloading. Global variables are those, which declared outside of class or any routine. The stack is used for allocating memory for local variables (which are declared in some function or procedure) and auxiliary data (such as return addresses or exception handlers). The heap is used for storing dynamic data.&lt;br /&gt;Note, that for variables of dynamic types (such as dynamic arrays, strings, objects or components) - though the variable itself is stored in global area or stack, but its data is always allocated on the heap and it (often) require manual control.&lt;br /&gt;&lt;br /&gt;Regardless of who allocates memory for the variable (you, manually or the compiler, automatically), memory for each variable must be allocated before its using, and later (when the variable is no longer needed) it should be freed.&lt;br /&gt;Sometimes there can be a situation, where your application trying to get access to certain memory location, which wasn’t allocated or was already released - due to bugs in your code. When such things happens - the CPU raises an exception of class EAccessViolation. The usual text for this error is as follows: “Access violation at address XXX in module ‘YYY’. Write/read of address ZZZ”. Though there is the one simple reason for this kind of error, the real situations for it can be very different.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-6632542319648547411?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/6632542319648547411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=6632542319648547411' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6632542319648547411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6632542319648547411'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/what-is-access-violation.html' title='What is an Access Violation'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-8821399507827908157</id><published>2009-05-10T16:21:00.000-07:00</published><updated>2009-05-10T16:22:15.723-07:00</updated><title type='text'>The server records for small business</title><content type='html'>Usually the boss needs accurate reports on all divisions «here and now» – in such moments, there is neither time, nor means to acquire and implement big cooperative systems. But, there is an easy solution to such tasks.&lt;br /&gt;&lt;br /&gt;Maybe, you had to undertake the installation of automatic systems at film level. Any such system must accumulate data, process it and give the result. Usually, there is already a working program support, which does all this, but when the data is accumulated, sometimes it happens that, the process is not enough and there isn’t the needed report. It is okay, if it’s possible to turn to the developer and ask to do everything, but this is not possible, if the program was installed a long time ago or was bought in a box .In this case, it is important to get a limited fast result which can satisfy the boss and will not be very expensive. The tools for IT development-infrastructure are now, as a rule, limited. But because of the automation, there is need to optimize the business process now, controlling it and as a result, future economy.&lt;br /&gt;&lt;br /&gt;Often there is need to do a difficult job, collect data from several bases, connect them together,analyse it and give the result in a group, accessible for analysis and controlling. The data can be different – text file, data base in the formats DBF-file, electronic file table. It happens that, the similar task cannot be solved or needs a lot of money to develop a specific program. Here, one might refuse automation, or to creating a specific solution – using early operating time and collecting constructors from different program «blocks», collect everything from the module available at the market, do a minimum binding and build upon a certain task.&lt;br /&gt;&lt;br /&gt;The company Fast Reports (fast-report.com) has got several program products on the market, which can substantially lessen the solution to the above given tasks. This is the very missing «block», which can handle the creation of reports and the given data in the needed form. The base to all these solutions, is a powerful report generator FastReport, which has shown itself to be dependable, fast and an easy solution for data processing. 11 years of successful work at the market has allowed the company to create an easy to use program product for information systems developers and users to create needed reports&lt;br /&gt;&lt;br /&gt;One of FastReports flag products – Report server. It is a stand-alone HTTP-server, which can be installed on any computer on a local network under the MS Windows 2000 and above operating system. Apart from the function saving static files, it can process query concerning the creation of reports, including the prior entrance of data through web forms. The user receives the result in form of HTML-page, by using an ordinary web browser or the format needed by him, for example, PDF, Open Office, Rich Text и and many others. The printing function is accessible on any printer on the network, registered on the computer, where FastReport Server, works. Server settings are very easy. Generally, it is ready to be used immediately after installation. If on the computer, there is already a different web server installed, then, only changing the number of the working port and restarting FastReportServer, is needed. It is possible to work together with the already installed web servers like IIS and Apache with the help of the CGI- application or in form of ISAP-module which comes with the FastReport Server packet. Doing that makes the running of the individual servers unnecessary – all the functions of the report server will concentrate on ISAPI DLL. All the server settings will be saved in xml-file, supplying comments and can be changed with the help of the program-configuration. All reports, being done on the FastReport Server, are compatible with the FastReport 4 format and can be transferred from early developed programs, in which FastReport 4 was. The user can, develop his own reports with the help of the FastReport Studio, report designer. Trial version comes together with the server packet, and the license of FastReport Studio Single the buyer of server, receives as a present. It is important to note the possibility of FastReport to create several connections to the data base in one report and collect information from different data bases. Generally, any data can be used, accessible through ODBC-driver&lt;br /&gt;&lt;br /&gt;Not long ago, Fast Reports released an update of its server solution. FastReport Server 2.1 has become stable and faster, improved the interaction with famous web servers like Microsoft IIS and Apache. The most important innovation became the possibility to use in the MS Windows authentication , which opens the possibility for a tight integration in the Active Directory domain and make simpler the running of records account and users group – each users group can form a report which it needs – managing – someone, accountant – another. And every user can be absolutely calm because of the accuracy of the information being received – the report will be formed on its query exactly at that moment, when it is needed!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-8821399507827908157?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/8821399507827908157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=8821399507827908157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8821399507827908157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8821399507827908157'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/server-records-for-small-business.html' title='The server records for small business'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-8926450055299457491</id><published>2009-05-09T18:26:00.001-07:00</published><updated>2009-05-09T18:26:59.648-07:00</updated><title type='text'>Execute a Delphi Method (Procedure/Function) by Name</title><content type='html'>When you need to convert an integer to a string, you would use the IntToStr Delphi function. When you need to display a form modally you would use the ShowModal method of a form object.&lt;br /&gt;&lt;p&gt;In short, functions, procedures and methods are called by their name. Ok, I know you knew that.&lt;br /&gt;&lt;p&gt;What if you need to call a function by its name as a string variable value? What if you need to use a code like:&lt;br /&gt;&lt;p&gt;ExecMethod(Form1, 'ShowModal'); &lt;/p&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;type&lt;br /&gt;   TForm1 = class(TForm)&lt;br /&gt;     Button1: TButton;&lt;br /&gt;     procedure Button1Click(Sender: TObject) ;&lt;br /&gt;     procedure CallMeByName(Sender: TObject) ;&lt;br /&gt;   private&lt;br /&gt;     procedure ExecMethod(OnObject: TObject; MethodName: string) ;&lt;br /&gt;   end;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;   Form1: TForm1;&lt;br /&gt;&lt;br /&gt;type&lt;br /&gt;   TExec = procedure of object;&lt;br /&gt;&lt;br /&gt;procedure TForm1.ExecMethod(OnObject: TObject; MethodName: string) ;&lt;br /&gt;var&lt;br /&gt;   Routine: TMethod;&lt;br /&gt;   Exec: TExec;&lt;br /&gt;begin&lt;br /&gt;   Routine.Data := Pointer(OnObject) ;&lt;br /&gt;   Routine.Code := OnObject.MethodAddress(MethodName) ;&lt;br /&gt;   if NOT Assigned(Routine.Code) then Exit;&lt;br /&gt;   Exec := TExec(Routine) ;&lt;br /&gt;   Exec;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.CallMeByName(Sender: TObject) ;&lt;br /&gt;begin&lt;br /&gt;   ShowMessage('Hello Delphi!') ;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.Button1Click(Sender: TObject) ;&lt;br /&gt;begin&lt;br /&gt;   ExecMethod(Form1, 'CallMeByName') ;&lt;br /&gt;end;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-8926450055299457491?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/8926450055299457491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=8926450055299457491' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8926450055299457491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8926450055299457491'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/execute-delphi-method-procedurefunction.html' title='Execute a Delphi Method (Procedure/Function) by Name'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-3210397056580228968</id><published>2009-05-08T18:25:00.000-07:00</published><updated>2009-05-08T18:26:57.335-07:00</updated><title type='text'>How to Remove the "Today" Mark from the TDateTimePicker</title><content type='html'>&lt;p&gt;The TDateTimePicker component displays a list box for entering dates or times. By design it displays the label "today" at the bottom of the control allowing a user to quickly select the today's date.&lt;br /&gt;&lt;p&gt;Here's how to remove the "today" marker from the TDateTimePicker. Handle the OnDropDown event as:&lt;br /&gt;&lt;blockquote class="yes"&gt;&lt;b&gt;uses&lt;/b&gt; CommCtrl, ...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;procedure&lt;/b&gt; TForm1.DateTimePicker1DropDown(Sender: TObject) ;&lt;br /&gt;&lt;b&gt;var&lt;/b&gt;&lt;br /&gt;   wnd: HWND;&lt;br /&gt;   style: Integer;&lt;br /&gt;&lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;   wnd := DateTime_GetMonthCal(DateTimePicker1.Handle) ;&lt;br /&gt;   &lt;b&gt;if&lt;/b&gt; wnd &amp;lt;&amp;gt; 0 &lt;b&gt;then&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;     style := GetWindowLong(wnd, GWL_STYLE) ;&lt;br /&gt;     SetWindowLong(wnd, GWL_STYLE, style &lt;b&gt;or&lt;/b&gt; MCS_NOTODAY &lt;b&gt;or&lt;/b&gt; MCS_NOTODAYCIRCLE) ;&lt;br /&gt;   &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-3210397056580228968?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/3210397056580228968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=3210397056580228968' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/3210397056580228968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/3210397056580228968'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/how-to-remove-today-mark-from.html' title='How to Remove the &quot;Today&quot; Mark from the TDateTimePicker'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-6173305441983691219</id><published>2009-05-08T18:22:00.000-07:00</published><updated>2009-05-08T18:23:19.152-07:00</updated><title type='text'>Finalizing DelphiLive Material</title><content type='html'>&lt;div class="post-body entry-content"&gt;Well today I am putting the finishing touches on my &lt;a href="http://www.delphilive.com/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;DelphiLive&lt;/span&gt;&lt;/a&gt; presentations.&lt;br /&gt;&lt;br /&gt;I will be presenting:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Power of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;RTTI&lt;/span&gt; In Delphi &lt;/li&gt;&lt;li&gt;Moving from &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;BDE&lt;/span&gt; to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;DBX&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I have this love hate relationship with PowerPoint, sometimes I find its the best way to communication information. However as soon as things get technical I really dislike seeing a bunch of code on slides.&lt;/p&gt;&lt;p&gt;In My Power of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;RTTI&lt;/span&gt; in Delphi Session I currently I have grand total of 3 Slides for this presentation the rest is code. &lt;/p&gt;&lt;p&gt;I will be covering: &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Interacting with Published Information&lt;/li&gt;&lt;li&gt;Dynamic Method Invocation&lt;/li&gt;&lt;li&gt;Dynamic Class Creation&lt;/li&gt;&lt;li&gt;Ideas on how you might use it your applications.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;In My &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;BDE&lt;/span&gt; to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;DBX&lt;/span&gt; Session, I have several slides, but don't worry I have plenty of code and examples to show.&lt;/p&gt;&lt;p&gt;One of the things I like the best about this presentation won't come till near the end, but at the State of Utah we wrote a simple &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;DFM&lt;/span&gt; parser and combined it with Martin &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;Waldenburg&lt;/span&gt; Delphi Parser (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;TmwPasLex&lt;/span&gt;) and wrote a simple but effective conversion utility. It saved us tons of time when converting a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;BDE&lt;/span&gt; Application to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;DBX&lt;/span&gt;. The application we converted was not a simple demo program, It has 650+ &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;DFMs&lt;/span&gt;. And several more units 500+ with no associated &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;dfm&lt;/span&gt;. That does not count any third party code, or our own internally developed components.&lt;/p&gt;&lt;p&gt;I have updated the conversion utility to be slightly more generic as the original was specific to our needs. I will share that code with the attendees.&lt;/p&gt;&lt;p&gt;I hope to see you there!&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-6173305441983691219?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/6173305441983691219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=6173305441983691219' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6173305441983691219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6173305441983691219'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/finalizing-delphilive-material.html' title='Finalizing DelphiLive Material'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-8069330090554474266</id><published>2009-05-07T18:31:00.000-07:00</published><updated>2009-05-07T18:32:20.554-07:00</updated><title type='text'>UK firm splashes out to buy Borland and Compuware</title><content type='html'>One of the grandees of the IT industry for the past 30 years, Borland Software, has been acquired by British software company Micro Focus International, in a cash deal worth £50 million ($75 million).&lt;br /&gt;&lt;br /&gt;At the same time, Micro Focus said it is also acquiring the application testing and automated software quality business of Compuware Corporation for £53 million ($80 million).&lt;br /&gt;&lt;br /&gt;Micro Focus said the two deals would give it a leading market position in the testing and automation market.&lt;br /&gt;&lt;br /&gt;Borland was founded way back in 1981 by three Danish citizens, but soon moved to the United States where it was headed up by the flamboyant Philippe Kahn, who led the company for most of the 1980s and 1990s.&lt;br /&gt;&lt;br /&gt;Borland developed a series of well-regarded software development tools during its existence, and is probably most associated with Turbo Pascal, Quattro Pro (spreadsheet), and Paradox (database). The company was also known for acquiring Ashton-Tate back in September 1991, a deal that netted it the dBase and InterBase databases, and for a time Borland was counted as a serious rival to both Microsoft and Oracle.&lt;br /&gt;&lt;br /&gt;But it soon found itself squeezed by its rivals and in 1998, Borland changed its name to Inprise Corporation in an effort to appeal to the enterprise applications development market. The idea was to integrate Borland's tools, Delphi, C++ Builder, and JBuilder with enterprise environment software. But the move backfired, and in January 2001, the Inprise name was abandoned and the company reverted to the "Borland" name once more.&lt;br /&gt;&lt;br /&gt;In February 2006 Borland announced the divestiture of its IDE division, including Delphi, JBuilder, and InterBase. At the same time it announced the planned acquisition of Segue Software, a maker of software test and quality tools. The spinoff was called CodeGear.&lt;br /&gt;&lt;br /&gt;From 2007, Borland concentrated on Application Lifecycle Management (ALM) and in May 2008 it sold its CodeGear division to Embarcadero Technologies.&lt;br /&gt;&lt;br /&gt;The deal to acquire Borland means that Micro Focus will expand its presence in the application testing market, where it already operates with its Data Express product.&lt;br /&gt;&lt;br /&gt;"Micro Focus's proposed acquisition of Borland represents the next logical stage in Micro Focus's growth journey," said Stephen Kelly, CEO of Micro Focus, in a statement. "Our organic performance remains strong as reflected in our trading statement also released today, and this transaction will add new scale and breadth to further develop our customer proposition, in an attractive adjacent market to our existing business."&lt;br /&gt;&lt;br /&gt;Newbury, Berkshire-based Micro Focus was founded back in the 1970s and is best known as a software provider that helps companies move older legacy software to more modern business systems.&lt;br /&gt;&lt;br /&gt;The UK company is also acquiring the application testing and automated software quality business of Compuware for $80 million, again also in cash. Compuware made its name in the testing, development and management software for programs running on mainframe computer and client-server systems.&lt;br /&gt;&lt;br /&gt;Micro Focus feels its products are "highly complementary to Micro Focus' core solutions as they address a logically adjacent portion of the software development and deployment value chain."&lt;br /&gt;&lt;br /&gt;"Acquiring the Compuware Testing and ASQ business is a logical extension to our existing application management proposition, and we see strong growth potential in this market," said Kelly.&lt;br /&gt;&lt;br /&gt;Both deals have been approved by the relevant boards, but still need shareholder and regulator approval. Micro Focus also said its group revenues for 2009 were expected to grow year on year by approximately 20 percent.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-8069330090554474266?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/8069330090554474266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=8069330090554474266' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8069330090554474266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8069330090554474266'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/uk-firm-splashes-out-to-buy-borland-and.html' title='UK firm splashes out to buy Borland and Compuware'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-878501222682887235</id><published>2009-05-07T18:28:00.001-07:00</published><updated>2009-05-07T18:28:46.933-07:00</updated><title type='text'>Silverpoint MultiInstaller</title><content type='html'>Silverpoint MultiInstaller is a multi component package installer for CodeGear Delphi and C++Builder, it was created to ease the components installation on the IDE.&lt;br /&gt;&lt;br /&gt;Silverpoint MultiInstaller can help you install multiple component packs in a few clicks.&lt;br /&gt;Just download the zips and select the destination folder, all the components will be uninstalled from the IDE if they were previously installed, unziped, patched, compiled and installed on the Delphi IDE.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Getting Started&lt;/strong&gt;&lt;br /&gt;To install a component pack with MultiInstaller you have to follow these steps:&lt;br /&gt;1) Read the licenses of the component packs you want to install.&lt;br /&gt;2) Get the zip files of component packs.&lt;br /&gt;3) Get the Silverpoint MultiInstaller.&lt;br /&gt;4) Get the Setup.ini file for that component pack installation or create one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-878501222682887235?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/878501222682887235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=878501222682887235' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/878501222682887235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/878501222682887235'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/silverpoint-multiinstaller.html' title='Silverpoint MultiInstaller'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-1855916650563169913</id><published>2009-05-06T20:45:00.000-07:00</published><updated>2009-05-06T20:46:38.318-07:00</updated><title type='text'>class helper to get SourceFileName from an EAssertionFailed</title><content type='html'>&lt;div class="entrytext"&gt;&lt;div class="snap_preview"&gt;&lt;p&gt;In one of our applications, we have a default Config.xml file that is in our source tree, but it can be overridden by a Config.xml file relative to the application’s .EXE file.&lt;br /&gt;&lt;br /&gt;So we have a two step process looking for the Config.xml, and we’d like to have the full path to the source file where the sources were build.&lt;br /&gt;&lt;br /&gt;It seems the only way to get that, is by looking inside the Message of an EAssertionFailed exception.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So I wrote yet another class helper to get this code to work:&lt;br /&gt;&lt;br /&gt;&lt;span id="more-67"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi" name="code"&gt;&lt;br /&gt;&lt;br /&gt;function GetConfigPathName(const Application: TApplication): string; overload;&lt;br /&gt;var&lt;br /&gt;  TriedFileNames: IStringListWrapper;&lt;br /&gt;  SourceFileName: string;&lt;br /&gt;begin&lt;br /&gt;  TriedFileNames := TStringListWrapper.Create();&lt;br /&gt;  Result := FindConfigPathName(Application, TriedFileNames);&lt;br /&gt;  try&lt;br /&gt;    AssertConfigFileNameExists(Result, Application.ExeName, TriedFileNames);&lt;br /&gt;  except&lt;br /&gt;    on E: EAssertionFailed do&lt;br /&gt;    begin&lt;br /&gt;      SourceFileName := E.GetSourceFileName();&lt;br /&gt;      Result := FindConfigPathName(SourceFileName, TriedFileNames);&lt;br /&gt;      AssertConfigFileNameExists(Result, Application.ExeName, SourceFileName, TriedFileNames);&lt;br /&gt;    end;&lt;br /&gt;  end;&lt;br /&gt;end;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Note the IStringListWrapper; I’ll get back to that in a later blog-post.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The full code of the class helper is right below.&lt;br /&gt;&lt;br /&gt;Just a few remarks:&lt;/p&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;EAssertionFailed is in the SysUtils unit, and builds its Message by formatting a string using the SAssertError const in the SysConst unit as a mask.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;We use that mask to “parse” the Message from right to left. Parsing from left to right is virtually impossible, as the first string is the assertion message itself, and we don’t know how that looks like.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If you are not using Delphi 2009, then replace the CharInSet call with a regular set check.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;pre class="delphi" name="code"&gt;&lt;br /&gt;&lt;br /&gt;unit AssertionFailedHelperUnit;&lt;br /&gt;&lt;br /&gt;interface&lt;br /&gt;&lt;br /&gt;uses&lt;br /&gt;  SysUtils;&lt;br /&gt;&lt;br /&gt;type&lt;br /&gt;  TAssertionFailedHelper = class helper for EAssertionFailed&lt;br /&gt;  public&lt;br /&gt;    function GetSourceFileName: string;&lt;br /&gt;  end;&lt;br /&gt;&lt;br /&gt;implementation&lt;br /&gt;&lt;br /&gt;uses&lt;br /&gt;  SysConst;&lt;br /&gt;&lt;br /&gt;function TAssertionFailedHelper.GetSourceFileName: string;&lt;br /&gt;var&lt;br /&gt;  Mask: string;&lt;br /&gt;  ExceptionMessage: string;&lt;br /&gt;  OpeningParenthesesPosition: Integer;&lt;br /&gt;begin&lt;br /&gt;  //no valid configuration file found relative to C:\Program Files\CodeGear\RAD Studio\6.0\bin\bds.exe (C:\develop\ActiveMQDemo\common\src\ConfigHelperUnit.pas, line 84)&lt;br /&gt;  //  SAssertError = '%s (%s, line %d)';&lt;br /&gt;  // now create this string " (, line 0)" and use it to parse from right to left&lt;br /&gt;  Mask := Format(SAssertError, ['', '', 0]);&lt;br /&gt;  ExceptionMessage := Self.Message;&lt;br /&gt;  // remove the closing ")"&lt;br /&gt;  if (ExceptionMessage &amp;lt;&amp;gt; '') then&lt;br /&gt;  begin&lt;br /&gt;    Delete(ExceptionMessage, Length(ExceptionMessage), 1);&lt;br /&gt;    Delete(Mask, Length(Mask), 1);&lt;br /&gt;    // remove the "0" from the Mask&lt;br /&gt;    Delete(Mask, Length(Mask), 1);&lt;br /&gt;  end;&lt;br /&gt;  while (ExceptionMessage &amp;lt;&amp;gt; '') and (CharInSet(ExceptionMessage[Length(ExceptionMessage)], ['0'..'9'])) do&lt;br /&gt;    Delete(ExceptionMessage, Length(ExceptionMessage), 1);&lt;br /&gt;  // from the right side, remove the ", line " portion&lt;br /&gt;  while (ExceptionMessage &amp;lt;&amp;gt; '') and (ExceptionMessage[Length(ExceptionMessage)] = Mask[Length(Mask)]) do&lt;br /&gt;  begin&lt;br /&gt;    Delete(ExceptionMessage, Length(ExceptionMessage), 1);&lt;br /&gt;    Delete(Mask, Length(Mask), 1);&lt;br /&gt;  end;&lt;br /&gt;  // now find the opening "("&lt;br /&gt;  OpeningParenthesesPosition := Length(ExceptionMessage);&lt;br /&gt;  while (ExceptionMessage &amp;lt;&amp;gt; '') and (ExceptionMessage[OpeningParenthesesPosition] &amp;lt;&amp;gt; '(') do&lt;br /&gt;    Dec(OpeningParenthesesPosition);&lt;br /&gt;  Delete(ExceptionMessage, 1, OpeningParenthesesPosition);&lt;br /&gt;  Result := ExceptionMessage;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;end.&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-1855916650563169913?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/1855916650563169913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=1855916650563169913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/1855916650563169913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/1855916650563169913'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/class-helper-to-get-sourcefilename-from.html' title='class helper to get SourceFileName from an EAssertionFailed'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-3499459418953402735</id><published>2009-05-05T19:16:00.000-07:00</published><updated>2009-05-05T19:19:12.918-07:00</updated><title type='text'>Understanding Delphi Project Files</title><content type='html'>&lt;div id="articlebody"&gt;&lt;p&gt;Since it is quite common for Delphi applications to share code or previously customized forms, Delphi organizes applications into what is called projects.&lt;br /&gt;&lt;p&gt;A project is made up of the visual interface along with the code that activates the interface. Each project can have multiple forms, allowing us to build applications that have multiple windows. The code that is needed for a form in our project is stored in a separate Unit file that Delphi automatically associates to the form. General code that we want to be shared by all the forms in our application is placed in unit files as well. Simply put, a Delphi project is a collection of files that make up an application.&lt;br /&gt;&lt;p&gt;What this means is that each project is made of one or more Form files (files with the &lt;i&gt;.dfm&lt;/i&gt; extension) and one or more Unit files (&lt;i&gt;.pas&lt;/i&gt; extension). We can also add resource files, and they are compiled into .RES files and linked when we compile the project.&lt;br /&gt;&lt;h3&gt;Project File&lt;/h3&gt;Each project is made up of a single project file (.dpr). Project files contain directions for building an application. This is normally a set of simple routines which open the main form and any other forms that are set to be opened automatically and then starts the program by calling the &lt;i&gt;Initialize&lt;/i&gt;, &lt;i&gt;CreateForm&lt;/i&gt; and &lt;i&gt;Run&lt;/i&gt; methods of the global Application object (which is actually a form of zero width and height, so it never actually appears on the screen).&lt;br /&gt;&lt;p&gt;Note: The global variable &lt;i&gt;Application&lt;/i&gt;, of type TApplication, is in every Delphi Windows application. Application encapsulates your application as well as provides many functions that occur in the background of the program. For instance, Application would handle how you would call a help file from the menu of your program.&lt;br /&gt;&lt;h3&gt;Project Unit&lt;/h3&gt;Use Project - View Source to display the project file for the current project.&lt;br /&gt;&lt;p&gt;Althogh you can look and edit the Project File, in most cases, you'll let Delphi maintain the DPR file. The main reason to view the project file is so we can see the units and forms that make up the project, and which form is specified as the application's main form.&lt;br /&gt;&lt;p&gt;Another reason to work with the project file is when we are creating a DLL rather than a stand-alone application or need some start-up code, such as a splash screen before the main form is created by Delphi.&lt;br /&gt;&lt;p&gt;Here is the default project file for a new application (containing one form: "Form1"):&lt;br /&gt;&lt;blockquote class="yes"&gt;&lt;b&gt;program&lt;/b&gt; Project1;&lt;br /&gt;&lt;b&gt;uses&lt;/b&gt;&lt;br /&gt;Forms,&lt;br /&gt;Unit1 in 'Unit1.pas' &lt;i&gt;{Form1}&lt;/i&gt;;&lt;br /&gt;&lt;i&gt;{$R *.RES}&lt;/i&gt;&lt;br /&gt;&lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;Application.Initialize;&lt;br /&gt;Application.CreateForm(TForm1, Form1) ;&lt;br /&gt;Application.Run;&lt;br /&gt;&lt;b&gt;end&lt;/b&gt;. &lt;/blockquote&gt;The &lt;b&gt;program&lt;/b&gt; keyword identifies this unit as a program's main source unit. You can see that the unit name, Project1, follows the program keyword (Delphi gives the project a default name until you save the project with a more meaningful name). When we run a project file from the IDE, Delphi uses the name of the Project file for the name of the EXE file that it creates.&lt;br /&gt;&lt;p&gt;Delphi reads the &lt;b&gt;uses&lt;/b&gt; clause of the project file to determine which units are part of a project.&lt;br /&gt;&lt;p&gt;The .dpr file is linked with the .pas file with the compile directive &lt;i&gt;{$R *.RES}&lt;/i&gt; (in this case ‘*’ represents the root of the .pas filename rather than "any file"). This compiler directive tells Delphi to include this project's resource file. The project's resource file contains such items as the project's icon image.&lt;br /&gt;&lt;p&gt;The &lt;b&gt;begin..end&lt;/b&gt; block is the main source-code block for the project.&lt;br /&gt;&lt;p&gt;Although &lt;b&gt;Initialize&lt;/b&gt; is the first method called in the main project source code, it is not the first code that is executed in an application. The application first executes the &lt;b&gt;"initialization" section of all the units&lt;/b&gt; used by the application.&lt;br /&gt;&lt;p&gt;The &lt;b&gt;Application.CreateForm&lt;/b&gt; statement loads the form specified in its argument. Delphi adds an Application.CreateForm statement to the project file for each form you add to the project. This code's job is to first allocate memory for the form. The statements are listed in the order the forms are added to the project. This is the order that the forms will be created in memory at runtime. If you want to change this order, do not edit the project source code. Use the ProjectOptions menu command.&lt;br /&gt;&lt;p&gt;The &lt;b&gt;Application.Run&lt;/b&gt; statement starts your application. This instruction tells the predeclared object called Application to begin processing the events that occur during the run of a program.&lt;br /&gt;&lt;h3&gt;An Example: Hide Main Form / Hide Taskbar Button&lt;/h3&gt;The Application object's &lt;b&gt;ShowMainForm&lt;/b&gt; property determines whether or not a form will show at startup. The only condition of setting this property is that it has to be called before the Application.Run line.&lt;br /&gt;&lt;blockquote class="yes"&gt;//Presume: Form1 is the MAIN FORM&lt;br /&gt;Application.CreateForm(TForm1, Form1) ;&lt;br /&gt;Application.ShowMainForm := False;&lt;br /&gt;Application.Run;&lt;br /&gt;&lt;/blockquote&gt;&lt;!--/gc--&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-3499459418953402735?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/3499459418953402735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=3499459418953402735' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/3499459418953402735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/3499459418953402735'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/understanding-delphi-project-files.html' title='Understanding Delphi Project Files'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-6040016126904371899</id><published>2009-05-05T19:12:00.000-07:00</published><updated>2009-05-05T19:13:41.098-07:00</updated><title type='text'>Design Your Delphi Program in a Way That it Keeps its Memory Usage in Check</title><content type='html'>When writing long running applications - the kind of programs that will spend most of the day minimized to the task bar or system tray, it can become important not to let the program 'run away' with memory usage.&lt;br /&gt;&lt;p&gt;Learn how to clean up the memory used by your Delphi program using the SetProcessWorkingSetSize Windows API function.&lt;br /&gt;&lt;h3&gt;Memory Usage of a Program / Application / Process&lt;/h3&gt;Take a look at the screen shot of the Windows Task Manager...&lt;br /&gt;&lt;p&gt;The two rightmost columns indicate CPU (time) usage and memory usage. If a process impacts on either of these severely, your system will slow down.&lt;br /&gt;&lt;p&gt;The kind of thing that frequently impacts on CPU usage is a program that is looping (ask any programmer that has forgotten to put a "read next" statement in a file processing loop). Those sorts of problems are usually quite easily corrected.&lt;br /&gt;&lt;p&gt;Memory usage on the other hand is not always apparent, and needs to be managed more than corrected. Assume for example that a capture type program is running.&lt;br /&gt;&lt;p&gt;This program is used right throughout the day, possibly for telephonic capture at a help desk, or for some other reason. It just doesn’t make sense to shut it down every twenty minutes and then start it up again. It’ll be used throughout the day, although at infrequent intervals.&lt;br /&gt;&lt;p&gt;If that program relies on some heavy internal processing, or has lots of art work on its forms, sooner or later its memory usage is going to grow, leaving less memory for other more frequent processes, pushing up the paging activity, and ultimately slowing down the computer. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-6040016126904371899?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/6040016126904371899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=6040016126904371899' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6040016126904371899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6040016126904371899'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/design-your-delphi-program-in-way-that.html' title='Design Your Delphi Program in a Way That it Keeps its Memory Usage in Check'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-6948619378349994543</id><published>2009-05-04T20:08:00.000-07:00</published><updated>2009-05-04T20:10:24.197-07:00</updated><title type='text'>How can I implement threads in my programs without using the VCL TThread object?</title><content type='html'>&lt;p&gt;I've done extensive work in multi-threaded applications. And in my experience, there&lt;br /&gt;have been times when a particular program I'm writing should be written as a&lt;br /&gt;multi-threaded application, but using the &lt;i&gt;TThread&lt;/i&gt; object just seems like overkill.&lt;br /&gt;For instance, I write a lot of single function programs; that is, the entire functionality&lt;br /&gt;(beside the user interface portion) of the program is contained in one single execution&lt;br /&gt;procedure or function. Usually, this procedure contains a looping mechanism (e.g. FOR,&lt;br /&gt;WHILE, REPEAT) that operates on a table or an incredibly large text file (for me, that's&lt;br /&gt;on the order of 500MB-plus!). Since it's just a single procedure, using a &lt;i&gt;TThread&lt;/i&gt;&lt;br /&gt;is just too much work for my preferences. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;For those experienced Delphi programmers, you know what happens to the user interface&lt;br /&gt;when you run a procedure with a loop in it: &lt;i&gt;The application stops receiving messages&lt;/i&gt;.&lt;br /&gt;The most simple way of dealing with this situation is to make a call to &lt;b&gt;Application.ProcessMessages&lt;/b&gt;&lt;br /&gt;within the body of the loop so that the application can still receive messages from&lt;br /&gt;external sources. And in many, if not most, cases, this is a perfectly valid thing to do.&lt;br /&gt;However, if some or perhaps even one of the steps within the loop take more than a couple&lt;br /&gt;of seconds to complete processing — as in the case of a query — &lt;b&gt;Application.ProcessMessages&lt;/b&gt;&lt;br /&gt;is practically useless because the application will only receive messages at the time the&lt;br /&gt;call is made. So what you ultimately achieve is intermittent response at best. Using a&lt;br /&gt;thread, on the other hand, frees up the interface because the process is running&lt;br /&gt;completely separate from the main thread of the program where the interface resides. So&lt;br /&gt;regardless of what you execute within a loop that is running in a separate thread, your&lt;br /&gt;interface will never get locked up. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Don't confuse the discussion above with multi-threaded user interfaces. What I'm&lt;br /&gt;talking about is executing long background threads that won't lock up your user interface&lt;br /&gt;while they run. This is an important distinction to make because it's not really&lt;br /&gt;recommended to write multi-user interfaces, because each thread that is created in the&lt;br /&gt;system has its own message queue. Thus, a message loop must be created to fetch messages&lt;br /&gt;out of the queue so they can be dispatched appropriately. The TApplication object that&lt;br /&gt;controls the UI would be the natural place to set up message loops for background threads,&lt;br /&gt;but it's not set up to detect when other threads are executed. The gist of all this is&lt;br /&gt;that the sole reason you create threads is to distribute processing of &lt;i&gt;independent&lt;/i&gt;&lt;br /&gt;tasks. Since the UI and controls are fairly integrated, threads just don't make sense here&lt;br /&gt;because in order to make the separate threads work together, you have to synchronize them&lt;br /&gt;to work in tandem, which practically defeats threading altogether! &lt;/p&gt;&lt;br /&gt;&lt;p&gt;I mentioned above that the &lt;i&gt;TThread&lt;/i&gt; object is overkill for really simple threaded&lt;br /&gt;stuff. This is strictly an opinion, but experience has made me lean that way. In any case,&lt;br /&gt;what is the alternative to TThread in Delphi? &lt;/p&gt;&lt;br /&gt;&lt;p&gt;The solution isn't so much an alternative as it is going a bit more low-level into the&lt;br /&gt;Windows API. I've said this several times before: The VCL is essentially one giant wrapper&lt;br /&gt;around the Windows API and all its complexities. But fortunately for us, Delphi provides a&lt;br /&gt;very easy way to access lower-level functionality beyond the &lt;i&gt;wrapper&lt;/i&gt; interface with&lt;br /&gt;which it comes. And even more fortunate for us, we can create threads using a simple&lt;br /&gt;Windows API function called &lt;b&gt;CreateThread&lt;/b&gt; to bypass the &lt;i&gt;TThread&lt;/i&gt; object&lt;br /&gt;altogether. As you'll see below, creating threads in this fashion is incredibly easy to&lt;br /&gt;do. &lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Setting Yourself Up&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;There are two distinct steps for creating a thread: 1)Create the thread itself, then 2)&lt;br /&gt;Provide a function that will act as the thread entry point. The thread function or &lt;i&gt;thread&lt;br /&gt;entry point&lt;/i&gt; is the function (actually the address of the function) that tells your&lt;br /&gt;thread where to start. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Unlike a regular function, there are some specific requirements regarding the thread&lt;br /&gt;function that you have to obey: &lt;ol&gt;&lt;br /&gt;&lt;li&gt;You can give the function any name you want, but it must be a function name (ie.&lt;br /&gt;function MyThreadFunc) &lt;/li&gt;&lt;br /&gt;&lt;li&gt;The function must have a single formal parameter of type &lt;i&gt;Pointer&lt;/i&gt; (I'll discuss&lt;br /&gt;this below) &lt;/li&gt;&lt;br /&gt;&lt;li&gt;The function return type is always LongInt &lt;/li&gt;&lt;br /&gt;&lt;li&gt;Its declaration must always be preceded by the &lt;b&gt;stdcall&lt;/b&gt; directive. This tells the&lt;br /&gt;compiler that the function will be passing parameters in the standard Windows convention. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p&gt;Whew! That seems like a lot but it's really not as complicated as it might seem from&lt;br /&gt;the description above. Here's an example declaration: &lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;b&gt;function&lt;/b&gt; MyThreadFunc(Ptr : Pointer) : LongInt; stdcall;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;That's it! Hope I didn't get you worried. The &lt;b&gt;CreateThread&lt;/b&gt; call is a bit more&lt;br /&gt;involved, but it too is not very complicated once you understand how to call it. Here's&lt;br /&gt;its declaration, straight out of the help file: &lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;b&gt;function&lt;/b&gt; CreateThread&lt;br /&gt;  (lpThreadAttributes: Pointer;    //Address of thread security attributes&lt;br /&gt;  dwStackSize: DWORD;             //Thread stack size&lt;br /&gt;  lpStartAddress: TFNThreadStartRoutine;//Address of the thread function&lt;br /&gt;  lpParameter: Pointer;                 //Input parameter for the thread&lt;br /&gt;  dwCreationFlags: DWORD;               //Creation flags&lt;br /&gt;  var lpThreadId: DWORD):               //ThreadID reference&lt;br /&gt;  THandle; stdcall;                     //Function returns a handle to the thread&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;This is not as complicated as it seems. First of all, you rarely have to set security&lt;br /&gt;attributes, so that can be set to &lt;b&gt;nil&lt;/b&gt;. Secondly, in most cases, your stack size can&lt;br /&gt;be 0 (actually, I've never found an instance where I have to set this to a value higher&lt;br /&gt;than zero). You can optionally pass a parameter through the &lt;i&gt;lpParameter&lt;/i&gt; argument as&lt;br /&gt;a pointer to a structure or address of a variable, but I've usually opted to use global&lt;br /&gt;variables instead (I know, this breaking a cardinal rule of structured programming, but it&lt;br /&gt;sure eases things). Lastly, I've rarely had to set creation flags unless I want my thread&lt;br /&gt;to start in a suspended state so I can do some preprocessing. For the most part, I set&lt;br /&gt;this value as zero. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Now that I've thoroughly confused you, let's look at an example function that creates a&lt;br /&gt;thread: &lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br /&gt;var&lt;br /&gt;  thr : THandle;&lt;br /&gt;  thrID : DWORD;&lt;br /&gt;begin&lt;br /&gt;  FldName := ListBox1.Items[ListBox1.ItemIndex];&lt;br /&gt;  thr := &lt;b&gt;CreateThread(nil, 0, @CreateRecID, nil, 0, thrID)&lt;/b&gt;;&lt;br /&gt;  if (thr = 0) then&lt;br /&gt;    ShowMessage('Thread not created');&lt;br /&gt;end;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Embarrassingly simple, right? It is. To make the thread in the function above, I&lt;br /&gt;declared two variables, &lt;b&gt;thr&lt;/b&gt; and &lt;b&gt;thrID&lt;/b&gt;, which stand for the handle of the&lt;br /&gt;thread and its identifier, respectively. I set a global variable that the thread function&lt;br /&gt;will access immediately before the call to &lt;b&gt;CreateThread&lt;/b&gt;, then make the declaration,&lt;br /&gt;assigning the return value of the function to &lt;b&gt;thr&lt;/b&gt; and inputting the address of my&lt;br /&gt;thread function, and the thread ID variable. The rest of the parameters I set to nil or 0.&lt;br /&gt;Not much to it. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Notice that the procedure that actually makes the call is an OnClick handler for a&lt;br /&gt;button on a form. You can pretty much create a thread anywhere in your code as long as you&lt;br /&gt;set up properly. Here's the entire unit code for my program; you can use it for a&lt;br /&gt;template. This program is actually fairly simple. It adds an incremental numeric key value&lt;br /&gt;to a table called RecID, based on the record number (which makes things really easy).&lt;br /&gt;Browse the code; we'll discuss it below: &lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;unit main;&lt;br /&gt;&lt;br /&gt;interface&lt;br /&gt;&lt;br /&gt;uses&lt;br /&gt;  Windows, Messages, SysUtils, Classes,&lt;br /&gt;  Graphics, Controls, Forms, Dialogs, DB, DBTables, StdCtrls, ComCtrls,&lt;br /&gt;  Buttons;&lt;br /&gt;&lt;br /&gt;type&lt;br /&gt;  TForm1 = class(TForm)&lt;br /&gt;    Edit1: TEdit;&lt;br /&gt;    Label1: TLabel;&lt;br /&gt;    OpenDialog1: TOpenDialog;&lt;br /&gt;    SpeedButton1: TSpeedButton;&lt;br /&gt;    Label2: TLabel;&lt;br /&gt;    StatusBar1: TStatusBar;&lt;br /&gt;    Button1: TButton;&lt;br /&gt;    ListBox1: TListBox;&lt;br /&gt;    procedure SpeedButton1Click(Sender: TObject);&lt;br /&gt;    procedure Button1Click(Sender: TObject);&lt;br /&gt;  end;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  Form1: TForm1;&lt;br /&gt;  TblName : String;&lt;br /&gt;  FldName : String;&lt;br /&gt;&lt;br /&gt;implementation&lt;br /&gt;&lt;br /&gt;{$R *.DFM}&lt;br /&gt;&lt;br /&gt;function CreateRecID(P : Pointer) : LongInt; stdcall;&lt;br /&gt;var&lt;br /&gt;  tbl : TTable;&lt;br /&gt;  I   : Integer;&lt;br /&gt;  ses : TSession;&lt;br /&gt;  msg : String;&lt;br /&gt;begin&lt;br /&gt;  Randomize; //Initialize random number generator&lt;br /&gt;  I := 0;&lt;br /&gt;  {Disable the Execute button so another thread can't be executed&lt;br /&gt;   while this one is running}&lt;br /&gt;  EnableWindow(Form1.Button1.Handle, False);          &lt;br /&gt;&lt;br /&gt;  {If you're going to access any data in a thread, you have to create a&lt;br /&gt;   separate }&lt;br /&gt;  ses := TSession.Create(Application);&lt;br /&gt;  ses.SessionName := 'MyRHSRecIDSession' + IntToStr(Random(1000));&lt;br /&gt;&lt;br /&gt;  tbl := TTable.Create(Application);&lt;br /&gt;  with tbl do begin&lt;br /&gt;    Active := False;&lt;br /&gt;    SessionName := ses.SessionName;&lt;br /&gt;    DatabaseName := ExtractFilePath(TblName); //TblName is a global variable set&lt;br /&gt;    TableName := ExtractFileName(TblName);      //in the SpeedButton's OnClick handler&lt;br /&gt;    Open;&lt;br /&gt;    First;&lt;br /&gt;    try&lt;br /&gt;          {Start looping structure}&lt;br /&gt;      while NOT EOF do begin&lt;br /&gt;        if (State &amp;lt;&amp;gt; dsEdit) then&lt;br /&gt;          Edit;&lt;br /&gt;        msg := 'Record ' + IntToStr(RecNo) + ' of ' + IntToStr(RecordCount);&lt;br /&gt;                {Display message in status bar}&lt;br /&gt;        SendMessage(Form1.StatusBar1.Handle, WM_SETTEXT, 0, LongInt(PChar(msg)));&lt;br /&gt;        FieldByName(FldName).AsInteger := RecNo;&lt;br /&gt;        Next;&lt;br /&gt;      end;&lt;br /&gt;    finally&lt;br /&gt;      Free;&lt;br /&gt;      ses.Free;&lt;br /&gt;      EnableWindow(Form1.Button1.Handle, True);&lt;br /&gt;    end;&lt;br /&gt;  end;&lt;br /&gt;  msg := 'Operation Complete!';&lt;br /&gt;  SendMessage(Form1.StatusBar1.Handle, WM_SETTEXT, 0, LongInt(PChar(msg)));&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.SpeedButton1Click(Sender: TObject);&lt;br /&gt;var&lt;br /&gt;  tbl : TTable;&lt;br /&gt;  I : Integer;&lt;br /&gt;begin&lt;br /&gt;  with OpenDialog1 do&lt;br /&gt;    if Execute then begin&lt;br /&gt;      Edit1.Text := FileName;&lt;br /&gt;      TblName := FileName;&lt;br /&gt;      tbl := TTable.Create(Application);&lt;br /&gt;      with tbl do begin&lt;br /&gt;        Active := False;&lt;br /&gt;        DatabaseName := ExtractFilePath(TblName);&lt;br /&gt;        TableName := ExtractFileName(TblName);&lt;br /&gt;        Open;&lt;br /&gt;        LockWindowUpdate(Self.Handle);&lt;br /&gt;        for I := 0 to FieldCount - 1 do begin&lt;br /&gt;          ListBox1.Items.Add(Fields[I].FieldName);&lt;br /&gt;        end;&lt;br /&gt;        LockWindowUpdate(0);&lt;br /&gt;        Free;&lt;br /&gt;      end;&lt;br /&gt;    end;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br /&gt;var&lt;br /&gt;  thr : THandle;&lt;br /&gt;  thrID : DWORD;&lt;br /&gt;begin&lt;br /&gt;  FldName := ListBox1.Items[ListBox1.ItemIndex];&lt;br /&gt;  thr := CreateThread(nil, 0, @CreateRecID, nil, 0, thrID);&lt;br /&gt;  if (thr = 0) then&lt;br /&gt;    ShowMessage('Thread not created');&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;end.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The most important function here, obviously, is the thread function, &lt;b&gt;CreateRecID&lt;/b&gt;.&lt;br /&gt;Let's take a look at it: &lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function CreateRecID(P : Pointer) : LongInt; stdcall;&lt;br /&gt;var&lt;br /&gt;  tbl : TTable;&lt;br /&gt;  I   : Integer;&lt;br /&gt;  ses : TSession;&lt;br /&gt;  msg : String;&lt;br /&gt;begin&lt;br /&gt;  Randomize; //Initialize random number generator&lt;br /&gt;  I := 0;&lt;br /&gt;  {Disable the Execute button so another thread can't be executed&lt;br /&gt;   while this one is running}&lt;br /&gt;  EnableWindow(Form1.Button1.Handle, False);          &lt;br /&gt;&lt;br /&gt;  {If you're going to access any data in a thread, you have to create a&lt;br /&gt;   separate }&lt;br /&gt;  ses := TSession.Create(Application);&lt;br /&gt;  ses.SessionName := 'MyRHSRecIDSession' + IntToStr(Random(1000));&lt;br /&gt;&lt;br /&gt;  tbl := TTable.Create(Application);&lt;br /&gt;  with tbl do begin&lt;br /&gt;    Active := False;&lt;br /&gt;    SessionName := ses.SessionName;&lt;br /&gt;    DatabaseName := ExtractFilePath(TblName); //TblName is a global variable set&lt;br /&gt;    TableName := ExtractFileName(TblName);      //in the SpeedButton's OnClick handler&lt;br /&gt;    Open;&lt;br /&gt;    First;&lt;br /&gt;    try&lt;br /&gt;          {Start looping structure}&lt;br /&gt;      while NOT EOF do begin&lt;br /&gt;        if (State &amp;lt;&amp;gt; dsEdit) then&lt;br /&gt;          Edit;&lt;br /&gt;        msg := 'Record ' + IntToStr(RecNo) + ' of ' + IntToStr(RecordCount);&lt;br /&gt;                {Display message in status bar}&lt;br /&gt;        SendMessage(Form1.StatusBar1.Handle, WM_SETTEXT, 0, LongInt(PChar(msg)));&lt;br /&gt;        FieldByName(FldName).AsInteger := RecNo;&lt;br /&gt;        Next;&lt;br /&gt;      end;&lt;br /&gt;    finally&lt;br /&gt;      Free;&lt;br /&gt;      ses.Free;&lt;br /&gt;      EnableWindow(Form1.Button1.Handle, True);&lt;br /&gt;    end;&lt;br /&gt;  end;&lt;br /&gt;  msg := 'Operation Complete!';&lt;br /&gt;  SendMessage(Form1.StatusBar1.Handle, WM_SETTEXT, 0, LongInt(PChar(msg)));&lt;br /&gt;end;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;This is a pretty basic function. I'll leave it up to you to follow the flow of&lt;br /&gt;execution. However, let's look at some very interesting things that are happening in the&lt;br /&gt;thread function. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;First of all, notice that I created a TSession object before I created the table I was&lt;br /&gt;going to access. This is to ensure that the program will behave itself with the BDE. This&lt;br /&gt;is required any time you access a table or other data source from within the context of a&lt;br /&gt;thread. I've explained this in more detail in another article called &lt;b&gt;How&lt;br /&gt;Can I Run Queries in Threads?&lt;/b&gt; Directly above that, I made a call to the Windows&lt;br /&gt;API function &lt;b&gt;EnableWindow&lt;/b&gt; to disable the button that executes the code. I had to do&lt;br /&gt;this because since the VCL is not thread-safe, there's no guarantee I'd be able to&lt;br /&gt;successfully access the button's &lt;b&gt;Enabled&lt;/b&gt; property safely. So I had to disable it&lt;br /&gt;using the Windows API call that performs enabling and disabling of controls. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Moving on, notice how I update the caption of a status bar that's on the bottom of the&lt;br /&gt;my form. First, I set the value of a text variable to the message I want displayed: &lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;msg := 'Record ' + IntToStr(RecNo) + ' of ' + IntToStr(RecordCount);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Then I do a &lt;b&gt;SendMessage&lt;/b&gt;, sending the WM_SETTEXT message to the status bar: &lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SendMessage(Form1.StatusBar1.Handle, WM_SETTEXT, 0, LongInt(PChar(msg)));&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;SendMessage&lt;/b&gt; will send a message directly to a control and bypass the window&lt;br /&gt;procedure of the form that owns it. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Why did I go to all this trouble? For the very same reason that I used &lt;b&gt;EnableWindow&lt;/b&gt;&lt;br /&gt;for the button that creates the thread. But unfortunately, unlike the single call to &lt;b&gt;EnableWindow&lt;/b&gt;,&lt;br /&gt;there's no other way to set the text of a control other than sending it the &lt;b&gt;WM_SETTEXT&lt;/b&gt;&lt;br /&gt;message. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;The point to all this sneaking behind the VCL is that for the most part, it's not safe&lt;br /&gt;to access VCL properties or procedures in threads. In fact, the objects that are&lt;br /&gt;particularly dangerous to access from threads are those descended from TComponent. These&lt;br /&gt;comprise a large part of the VCL, so in cases where you have to perform some interaction&lt;br /&gt;with them from a thread, you'll have to use a roundabout method. But as you can see from&lt;br /&gt;the code above, it's not all that difficult. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Of the thousands of functions in the Windows API, &lt;b&gt;CreateThread&lt;/b&gt; is one of the&lt;br /&gt;most simple and straightforward. I spent a lot of time explaining things here, but there's&lt;br /&gt;a lot of ground I didn't cover. Use this example as a template for your thread&lt;br /&gt;exploration. Once you get the hang of it, you'll use threads in practically everything you&lt;br /&gt;do. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-6948619378349994543?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/6948619378349994543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=6948619378349994543' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6948619378349994543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6948619378349994543'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/how-can-i-implement-threads-in-my.html' title='How can I implement threads in my programs without using the VCL TThread object?'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-2566717502731006206</id><published>2009-05-03T18:24:00.000-07:00</published><updated>2009-05-03T18:26:02.060-07:00</updated><title type='text'>Get the Url of a Hyperlink when the Mouse moves Over a TWebBrowser Document</title><content type='html'>&lt;p&gt;The TWebBrowser Delphi component provides access to the Web browser functionality from your Delphi applications.&lt;br /&gt;&lt;p&gt;In most situations you use the TWebBrowser to display HTML documents to the user - thus creating your own version of the (Internet Explorer) Web browser. Note that the TWebBrowser can also display Word documents, for example.&lt;br /&gt;&lt;p&gt;A very nice feature of a Browser is to display link information, for example, in the status bar, when the mouse hovers over a link in a document.&lt;br /&gt;&lt;p&gt;The TWebBrowser does not expose an event like "OnMouseMove". Even if such an event would exist it would be fired for the TWebBrowser component - NOT for the document being displayed inside the TWebBrowser.&lt;br /&gt;&lt;p&gt;In order to provide such information (and much more, as you will see in a moment) in your Delphi application using the TWebBrowser component, a technique called "&lt;b&gt;events sinking&lt;/b&gt;" must be implemeted.&lt;br /&gt;&lt;h3&gt;WebBrowser Event Sink&lt;/h3&gt;To navigate to a web page using the TWebBrowser component you call the &lt;i&gt;Navigate&lt;/i&gt; method. The &lt;i&gt;Document&lt;/i&gt; property of the TWebBrowser returns an &lt;i&gt;IHTMLDocument2&lt;/i&gt; value (for web documents). This interface is used to retrieve information about a document, to examine and modify the HTML elements and text within the document, and to process related events.&lt;br /&gt;&lt;p&gt;To get the "href" attribute (link) of an "a" tag inside a document, while the mouse hovers over a document, you need to react on the "onmousemove" event of the IHTMLDocument2.&lt;br /&gt;&lt;p&gt;Here are the steps to sink events for the currently loaded document:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Sink the WebBrowser control's events in the &lt;i&gt;DocumentComplete&lt;/i&gt; event raised by the TWebBrowser. This event is fired when the document is fully loaded into the Web Browser.&lt;br /&gt;&lt;li&gt;Inside DocumentComplete, retrieve the WebBrowser's document object and sink the HtmlDocumentEvents interface.&lt;br /&gt;&lt;li&gt;Handle the event you are interested in.&lt;br /&gt;&lt;li&gt;Clear the sink in the in &lt;i&gt;BeforeNavigate2&lt;/i&gt; - that is when the new document is loaded in the Web Browser. &lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;h3&gt;HTML Document OnMouseMove&lt;/h3&gt;Since we are interested in the HREF attribute of an A element - in order to show the URL of a link the mouse is over, we will sink the "onmousemove" event.&lt;br /&gt;&lt;p&gt;The procedure to get the tag (and its attributes) "below" the mouse can be defined as:&lt;br /&gt;&lt;blockquote class="yes"&gt;&lt;b&gt;var&lt;/b&gt;&lt;br /&gt;  htmlDoc : IHTMLDocument2;&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;b&gt;procedure&lt;/b&gt; TForm1.Document_OnMouseOver;&lt;br /&gt;&lt;b&gt;var&lt;/b&gt;&lt;br /&gt;   element : IHTMLElement;&lt;br /&gt;&lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;if&lt;/b&gt; htmlDoc = &lt;b&gt;nil&lt;/b&gt; &lt;b&gt;then&lt;/b&gt; Exit;&lt;br /&gt;&lt;br /&gt;   element := htmlDoc.parentWindow.event.srcElement;&lt;br /&gt;&lt;br /&gt;   elementInfo.Clear;&lt;br /&gt;&lt;br /&gt;   &lt;b&gt;if&lt;/b&gt; LowerCase(element.tagName) = 'a' then&lt;br /&gt;   &lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;     ShowMessage('Link, HREF : ' + element.getAttribute('href',0)]) ;&lt;br /&gt;   &lt;b&gt;end&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;else&lt;/b&gt; &lt;b&gt;if&lt;/b&gt; LowerCase(element.tagName) = 'img' &lt;b&gt;then&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;     ShowMessage('IMAGE, SRC : ' + element.getAttribute('src',0)]) ;&lt;br /&gt;   &lt;b&gt;end&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;else&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;     elementInfo.Lines.Add(Format('TAG : %s',[element.tagName])) ;&lt;br /&gt;   &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;b&gt;end&lt;/b&gt;; &lt;i&gt;(*Document_OnMouseOver*)&lt;/i&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;As explained above, we attach to the onmousemove event of a document in the OnDocumentComplete event of a TWebBrowser:&lt;br /&gt;&lt;blockquote class="yes"&gt;&lt;b&gt;procedure&lt;/b&gt; TForm1.WebBrowser1DocumentComplete(   ASender: TObject;&lt;br /&gt;  const pDisp: IDispatch;&lt;br /&gt;  var URL: OleVariant) ;&lt;br /&gt;&lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;if&lt;/b&gt; Assigned(WebBrowser1.Document) &lt;b&gt;then&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;     htmlDoc := WebBrowser1.Document &lt;b&gt;as&lt;/b&gt; IHTMLDocument2;&lt;br /&gt;&lt;br /&gt;     htmlDoc.onmouseover := (TEventObject.Create(Document_OnMouseOver) &lt;b&gt;as&lt;/b&gt; IDispatch) ;&lt;br /&gt;   &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;b&gt;end&lt;/b&gt;; &lt;i&gt;(*WebBrowser1DocumentComplete*)&lt;/i&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;And this is where the problems arise! As you might guess the "onmousemove" event is *not* a usual event - as are those we are used to work with in Delphi.&lt;br /&gt;&lt;p&gt;The "onmousemove" expects a pointer to a variable of type VARIANT of type VT_DISPATCH that receives the IDispatch interface of an object with a default method that is invoked when the event occurs.&lt;br /&gt;&lt;p&gt;In order to attach a Delphi procedure to "onmousemove" you need to create a wrapper that implements IDispatch and raises your event in its Invoke method.&lt;br /&gt;&lt;p&gt;Here's the TEventObject interface:&lt;br /&gt;&lt;blockquote class="yes"&gt;TEventObject = &lt;b&gt;class&lt;/b&gt;(TInterfacedObject, IDispatch)&lt;br /&gt;&lt;b&gt;private&lt;/b&gt;&lt;br /&gt;   FOnEvent: TObjectProcedure;&lt;br /&gt;&lt;b&gt;protected&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;function&lt;/b&gt; GetTypeInfoCount(&lt;b&gt;out&lt;/b&gt; Count: Integer): HResult; stdcall;&lt;br /&gt;   &lt;b&gt;function&lt;/b&gt; GetTypeInfo(Index, LocaleID: Integer; &lt;b&gt;out&lt;/b&gt; TypeInfo): HResult; stdcall;&lt;br /&gt;   &lt;b&gt;function&lt;/b&gt; GetIDsOfNames(&lt;b&gt;const&lt;/b&gt; IID: TGUID; Names: Pointer; NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; stdcall;&lt;br /&gt;   &lt;b&gt;function&lt;/b&gt; Invoke(DispID: Integer; &lt;b&gt;const&lt;/b&gt; IID: TGUID; LocaleID: Integer; Flags: Word; &lt;b&gt;var&lt;/b&gt; Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; stdcall;&lt;br /&gt;&lt;b&gt;public&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;constructor&lt;/b&gt; Create(&lt;b&gt;const&lt;/b&gt; OnEvent: TObjectProcedure) ;&lt;br /&gt;   &lt;b&gt;property&lt;/b&gt; OnEvent: TObjectProcedure &lt;b&gt;read&lt;/b&gt; FOnEvent &lt;b&gt;write&lt;/b&gt; FOnEvent;&lt;br /&gt;   &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-2566717502731006206?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/2566717502731006206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=2566717502731006206' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2566717502731006206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2566717502731006206'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/05/get-url-of-hyperlink-when-mouse-moves.html' title='Get the Url of a Hyperlink when the Mouse moves Over a TWebBrowser Document'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-1315729800898276258</id><published>2009-04-30T18:31:00.000-07:00</published><updated>2009-04-30T18:33:08.639-07:00</updated><title type='text'>TMS Advanced Toolbars &amp; Menus v3.7.5.0</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_e42QR63MTVU/SfpRPvFsCJI/AAAAAAAAADk/SyqZHX3EYCE/s1600-h/atbv1_small.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5330662439726614674" style="FLOAT: right; MARGIN: 0px 0px 10px 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 221px" alt="" src="http://3.bp.blogspot.com/_e42QR63MTVU/SfpRPvFsCJI/AAAAAAAAADk/SyqZHX3EYCE/s400/atbv1_small.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What's new &amp;amp; improved in version 3.7.5.0 New : SubMenuCaptionFont added in AdvPreviewMenu styler to have different title &amp;amp; caption font&lt;br /&gt;New : PagerCaption.TextColorExtended added to allow to set different font for appname/docname in Window caption&lt;br /&gt;New : Text property to put text on top of the shapebutton image&lt;br /&gt;Improved : dropdown arrow on left docked toolbars painted in right direction&lt;br /&gt;Improved : glass frame drawing on Windows Vista with Aero theme&lt;br /&gt;Various smaller fixes &amp;amp; code improvements&lt;br /&gt;All toolbar/ribbon components are also included in TMS Component Pack&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-1315729800898276258?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/1315729800898276258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=1315729800898276258' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/1315729800898276258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/1315729800898276258'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/tms-advanced-toolbars-menus-v3750.html' title='TMS Advanced Toolbars &amp; Menus v3.7.5.0'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_e42QR63MTVU/SfpRPvFsCJI/AAAAAAAAADk/SyqZHX3EYCE/s72-c/atbv1_small.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-6373449114423951941</id><published>2009-04-30T18:28:00.000-07:00</published><updated>2009-04-30T18:29:53.351-07:00</updated><title type='text'>How do you improve Quality</title><content type='html'>&lt;div class="post-body entry-content"&gt;There typically are 3 types of projects, when it comes to quality that I have seen.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The focus is getting the code out the door and then you pick up the pieces.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The focus is on getting quality code out the door until deadline nears then you revert to number 1.&lt;/li&gt;&lt;li&gt;The focus is on getting quality code out the door and as deadline nears features may be dropped and the deadline may slip.&lt;/li&gt;&lt;/ol&gt;When the project starts everyone seems to be on board with the idea of #3 but typically I have seen it slip all the way to #1 quite quickly.&lt;br /&gt;&lt;br /&gt;At my current employer we have an internal application that is used by 300+ end users.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;We used to have:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;ZERO people dedicated to QA. (4-5 Delphi Developers, 1 Mainframe Programmer, no analysts)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Testing was done by end users testing as they had time.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;We had no automated or unit tests.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The build process was compile from your own machine and copy it the network, with any developer free to release any code they wanted. Which would sometimes step over the other developers uncommitted code.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;We had two environment's&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Development used by both developers and testing.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Production &lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Exceptions had no details or context to help track down problems.&lt;/li&gt;&lt;li&gt;We had a very small and painful bug tracking system.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;We would commonly be related to #1 type model above.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Over the few years that I have been here we have made many changes.&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;We now have:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;We now have three people dedicated to QA. ( 7 Delphi Developers, 1 Database PL/SQL developer, and 1 Analyst)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;We have end users still testing with the time that they have. But we now have better management support to get additional time needed.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;We have a few automated tests, and a few more unit tests, but we really could use many more.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Our build process runs every hour through &lt;a href="http://www.finalbuilder.com/"&gt;Final Builder&lt;/a&gt;, alerting us with email when someone checks in bad code.&lt;/li&gt;&lt;li&gt;We now have 4 environment's&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Development (Dedicated to Developers only)&lt;/li&gt;&lt;li&gt;TEST where users get first look&lt;/li&gt;&lt;li&gt;QA a final look before production usually with data refreshed from production&lt;/li&gt;&lt;li&gt;Production.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;We now use the &lt;a href="http://jcl.delphi-jedi.org/"&gt;JCL Debug&lt;/a&gt; to help use find those Hard to Reproduce Errors.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;We have a better bug tracking system, but still not nearly as nice as some of the home grown solutions I have used at past employers.&lt;/li&gt;&lt;li&gt;We are now some where between the #2 and #3 model's above.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Every release we ask what can we do better? We try to learn from our mistakes and implement solutions to prevent problems. We release a new version of our software nearly every month, so we are continually improving, and quality has improved in many ways in the past few years.&lt;br /&gt;&lt;br /&gt;However, today I feel awful!&lt;br /&gt;&lt;br /&gt;We put out a release on Friday morning last week. I don't think I have ever had a release go bad as this one has. Today we are still working on fixing major problems that were caused by the release.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Some of which would have been caught by better testing. &lt;/li&gt;&lt;li&gt;Some of which would have been caught by better management of the information coming in about problems. (i.e. it was reported but not acted on!) Since, I usually manage this information, it's the reason I feel awful. &lt;/li&gt;&lt;li&gt;Of course like all systems some of them would have taken an unreasonable amount of testing to find. &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;So I have been thinking, it's time to go back to and look at quality in new and different ways.&lt;br /&gt;&lt;br /&gt;I have been making a list for a while that specific to our product on ways to improve quality. Several items on the list are general enough to share with others.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Build a health check system detects common/possible problems that can be run daily in each environment's, which is very database specific. We have scripts for all of these, but not an automated way to run them.&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Tables without primary keys&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Missing Synonyms&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Invalid Synonyms&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Tables without indexes&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Missing Grants&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Disabled Constraints in Oracle&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Tables that have not been analyzed recently.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;FK Constraints without index on child table (table level lock will be placed on the parent table if these are found)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Invalid Database Objects&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Plus several that are specific to our schema, i.e. constraints that can't be described in meta data.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Error Messages (Exceptions)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Ability to Send error messages to a web service&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Ability to capture a screen shot with the error message.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Ability to ask users what they are doing when the exception occurred.&lt;/li&gt;&lt;li&gt;Ability to attach reported errors to items in bug tracking system.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Code Review to help identify and build additional unit tests around the code.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Automated Performance Testing Benchmark system. (I think &lt;a href="http://sourceforge.net/projects/dunit/"&gt;DUnit&lt;/a&gt; has something that will work for us)&lt;/li&gt;&lt;li&gt;Get current Delphi Unit tests into an daily build and smoke test instead of just being run by hand by developers.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;Ok...&lt;br /&gt;&lt;br /&gt;I have shared some of my ideas on how to improve quality, as well as some of the things we have done.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;How have you improved Quality in the software you write?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I am open to any suggestions, this is just a small attempt to think out side of the box.&lt;br /&gt;&lt;br /&gt;Since I just started this blog, I really hope that someone is reading this and has some good ideas they are willing to share.&lt;br /&gt;&lt;div style="CLEAR: both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-6373449114423951941?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/6373449114423951941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=6373449114423951941' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6373449114423951941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/6373449114423951941'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/how-do-you-improve-quality.html' title='How do you improve Quality'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-5085351741460281523</id><published>2009-04-29T20:54:00.001-07:00</published><updated>2009-04-29T20:55:19.914-07:00</updated><title type='text'>Code Beautifier Collection 6 for CodeGear RAD Studio 2007 is an open source expert</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_e42QR63MTVU/SfkhIOB1meI/AAAAAAAAADc/smEJ1etcRl0/s1600-h/o_o_bds.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5330328059058166242" style="FLOAT: right; MARGIN: 0px 0px 10px 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 311px" alt="" src="http://1.bp.blogspot.com/_e42QR63MTVU/SfkhIOB1meI/AAAAAAAAADc/smEJ1etcRl0/s400/o_o_bds.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Special Tip&lt;br /&gt;The 7.0 series code named CandyCan is under development. A milestone will be provided soon.&lt;br /&gt;History&lt;br /&gt;Since its birthday in May, 2005, it has served hundreds of C#Builder 1.0, Delphi 8 for .NET, Delphi 2005, and Delphi 2006 users. Because RAD Studio 2007 (including Delphi 2007 and C++Builder 2007) is built on .NET 2.0 platform, 5.x generation support and update is discontinued and here comes a new 6.0 generation, which fully takes advantage of .NET 2.0 platform.&lt;br /&gt;Notice&lt;br /&gt;After installation, you can read the user manual (manual.pdf) to know more about Code Beautifier Collection and how it can improve your Delphi coding experience.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-5085351741460281523?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/5085351741460281523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=5085351741460281523' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/5085351741460281523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/5085351741460281523'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/code-beautifier-collection-6-for.html' title='Code Beautifier Collection 6 for CodeGear RAD Studio 2007 is an open source expert'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_e42QR63MTVU/SfkhIOB1meI/AAAAAAAAADc/smEJ1etcRl0/s72-c/o_o_bds.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-3023991426912850876</id><published>2009-04-29T20:44:00.000-07:00</published><updated>2009-04-29T20:46:02.373-07:00</updated><title type='text'>DeHL 0.3 is out</title><content type='html'>&lt;div class="entrybody"&gt;&lt;p&gt;I’m proud to announce the 0.3 version of &lt;strong&gt;DeHL&lt;/strong&gt; library. This release focused on bug-fixes and extensions to type support engine. This version should pretty much stabilize what I started and should leave me more time to extend other interesting parts of the library such as collections.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;For those who are new, DeHL is a project of mine designed to fill in some holes in the Delphi’s RTL — most notably, some&lt;strong&gt; centralized and OOP-ish Date/Time support&lt;/strong&gt;, more&lt;strong&gt; generic collection classes&lt;/strong&gt; and&lt;strong&gt; “big integer” math&lt;/strong&gt; support. DeHL also builds up a new layer of “type support” which is very useful to abstract all type management tasks in generic classes. This projects only supports Delphi 2009 (and above) since &lt;strong&gt;Generics&lt;/strong&gt;, &lt;strong&gt;Anonymous methods&lt;/strong&gt;, and &lt;strong&gt;Unicode&lt;/strong&gt; are widely used whithin the library. &lt;span style="TEXT-DECORATION: underline"&gt;So even if you are not interested in the library itself, it may prove a good read if you are interested in all new features Delphi 2009 has to offer&lt;/span&gt;.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;New features:&lt;/h2&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Type support classes now expose methods to convert a type from an to a Variant.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Based on the newly added Variant conversion, a new type: &lt;em&gt;TConverter&lt;/em&gt;&amp;lt;T1, T2&amp;gt; is present. You can use it to support “blind” conversion in a class.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Much improved type support system&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Now more functionality is split between generic and non-generic variants of the type support classes (&lt;em&gt;IType&lt;/em&gt;, &lt;em&gt;IType&lt;/em&gt;&amp;lt;T&amp;gt;, &lt;em&gt;TType&lt;/em&gt;, &lt;em&gt;TType&lt;/em&gt;&amp;lt;T&amp;gt;).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;TypeSupport has been renamed to TType and IType repectively.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;IType/TType now export Name, Size, Management, TypeInfo and Family properties. You can use those properties to get more information about your generic type.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Custom type registration has been improved. A new cleaner API can be used to register you custom types into the DeHL’s type system.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;TType&amp;lt;T&amp;gt;.Default is now an overloaded function. The first form is the usual one. The second form receives a set of “type families” that are expected to represent the generic type. This way you can effectively impose run-time type restrictions.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;em&gt;TClassType&lt;/em&gt; is now generic with T being class-restricted. This allows to avoid compile-time type incompatibilities.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;All important standard types in Delphi are now supported. This support required the working custom types system, since these types can’t be handled “&lt;em&gt;by default&lt;/em&gt;“:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Boolean, ByteBool, WordBool, LongBool&lt;/li&gt;&lt;br /&gt;&lt;li&gt;TDateTime, TTime, TDate&lt;/li&gt;&lt;br /&gt;&lt;li&gt;NativeInt, NativeUInt&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Real&lt;/li&gt;&lt;br /&gt;&lt;li&gt;OleVariant&lt;/li&gt;&lt;br /&gt;&lt;li&gt;UCS4Char, UCS4String&lt;/li&gt;&lt;br /&gt;&lt;li&gt;UTF8String&lt;/li&gt;&lt;br /&gt;&lt;li&gt;RawByteString&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2&gt;Bug fixes:&lt;/h2&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Fixed a bug in &lt;em&gt;BigCardinal&lt;/em&gt; and &lt;em&gt;BigInteger&lt;/em&gt; variant types related to string conversion.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;A few changes in &lt;em&gt;TDictionary&lt;/em&gt; to avoid compiler problems.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In a multi-threaded environment, the custom type support would not unlock properly leading to a dead-lock.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Cleanup routines for &lt;em&gt;TDictionary&lt;/em&gt; and &lt;em&gt;THashSet&lt;/em&gt; were flawed since those used &lt;em&gt;FillChar&lt;/em&gt; to clear the array. Managed types had problems with that.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Char type support class now acts properly.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;&lt;em&gt;Note: It may be possible that the Testing project will not compile due to a bug in the Delphi compiler. But that should not prevent the usage of the library itself.&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="sociable"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-3023991426912850876?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/3023991426912850876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=3023991426912850876' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/3023991426912850876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/3023991426912850876'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/dehl-03-is-out.html' title='DeHL 0.3 is out'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-4323241651129241199</id><published>2009-04-28T19:59:00.000-07:00</published><updated>2009-04-28T20:00:27.557-07:00</updated><title type='text'>Steganography with Delphi - Hide Data Inside Images</title><content type='html'>According to Wikipedia, Steganography is "the art and science of writing hidden messages in such a way that no-one, apart from the sender and intended recipient, suspects the existence of the message, a form of security through obscurity".&lt;br /&gt;&lt;br /&gt;In computer terms, steganography means hiding a message within a larger one in such a way that others cannot see the presence or contents of the hidden message.&lt;br /&gt;&lt;br /&gt;Interested in how to code a Delphi application to hide data inside an image using cryptography - steganography?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;StegaImage - Steganography with Delphi&lt;br /&gt;&lt;/strong&gt;StegaImage is a little Delphi application to hide files (information) inside crypted images.&lt;br /&gt;Take a file, hide it inside a BMP image, and that's all. All you get is a new image that looks like the original, but it has the data hidden inside it.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How does StegaImage work?&lt;/strong&gt;&lt;br /&gt;In a 24-bit bitmap, each pixel is made up of a 24-bit number. Each number is composed of three 8-bit numbers (the R, G and B channels). These are the intensity of the Red, Green and Blue colors that create the final color of the pixel.&lt;br /&gt;To hide something inside the image, we will replace the Least Significant Bit (this is, the "rightmost" bit) of each 8-bit channel of every pixel, with the bits of the file we want to hide.&lt;br /&gt;&lt;br /&gt;The image will lose some quality because now the colors of the pixels are not the same, but it will go unnoticed to the human eye.&lt;br /&gt;&lt;br /&gt;Obviously, since we are storing only 3 bits per pixel, the image must have a phenomenal size to accommodate just a tiny little file.&lt;br /&gt;&lt;br /&gt;For example, if we want to hide 1 MB of data, we need an image with 2,796,203 pixels, which would have a size of something like 2,200 x 1,320 pixels. And that is a 8.3 MB file!&lt;br /&gt;We could replace the 2, 3 or 4 rightmost bits of every channel in order to increase the amount of data we can hide, but the quality could decrease considerably.&lt;br /&gt;Try 8 bits per channel and you'll see what I'm talking about (amazingly, 7 normally produces intelligible - although very ugly- images).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-4323241651129241199?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/4323241651129241199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=4323241651129241199' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4323241651129241199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4323241651129241199'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/steganography-with-delphi-hide-data.html' title='Steganography with Delphi - Hide Data Inside Images'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-469098223257786389</id><published>2009-04-28T19:19:00.000-07:00</published><updated>2009-04-28T19:21:12.532-07:00</updated><title type='text'>Why should you always use FreeAndNil instead of Free</title><content type='html'>&lt;p&gt;Well, when someone talks about object creation and destruction, he usually imagine something like this:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;However, I want to show that &lt;strong&gt;you should avoid “Free” call, whenever possible&lt;/strong&gt; - by replacing it with call to FreeAndNil, for example:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Please, note, that I mean replacing Free -&amp;gt; FreeAndNil everywhere. I talk not about just using FreeAndNil, when you want to use “Assigned(SomeObj)”, but I really mean &lt;strong&gt;everywhere&lt;/strong&gt; - by do not using Free at all. Yes, including cases with local variables.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Why? The reason is simple: &lt;em&gt;there is no reason for not-doing it&lt;/em&gt;. And this post explains why it is so.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;When you tell this to common Delphi developer, there are high chances that he’ll vote against it, saying:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;1. &lt;em&gt;Free + nil is not full equivalent of FreeAndNil. FreeAndNil clear pointer first and calls destructor second. If your code uses this reference - it will no longer work. For example, if we clear class field, but some internal class uses it during destruction process.&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Well, I count it as advantage. It helps to catch bad-design. Because you just described a case, when your code either uses variable instead of Self (i.e. Form1.SomeObj instead of SomeObj) or accesses a partial-constructed object (actually, it is more like partially deleted object now). And by using FreeAndNil you can catch these cases.&lt;br /&gt;&lt;br /&gt;Yes, such situations &lt;em&gt;can be made “by-design”&lt;/em&gt;, but even so - &lt;em&gt;you will detect an error immediately&lt;/em&gt; (obviosly, there will be Access Violation), so you can revert changes back, if you don’t want to redesign your code.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;2. &lt;em&gt;So what are examples of righteous/warrantable usage of FreeAndNil?&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Hmm, it is not very clear, what example can be provided here. Excluding complicated examples (like in previous block), your code will work the very same way - with or without FreeAndNil. Replacing Free -&amp;gt; FreeAndNil - it is a pure optional action.&lt;br /&gt;&lt;br /&gt;You can compare FreeAndNil with seat (safety) belts in cars: if you application runs normally - then FreeAndNil won’t be useful. But if your code mess up with something - then FreeAndNil (as seat belts too) &lt;em&gt;will protect you from consequences&lt;/em&gt;. By clearing the reference, &lt;strong&gt;FreeAndNil will help you to catch your wrong access immediately&lt;/strong&gt;. Without it (i.e. by using Free only), your code may continue to run (even without raising an exception) and &lt;strong&gt;gave the wrong results or damage global state&lt;/strong&gt;. It is quite dangerous.&lt;br /&gt;&lt;br /&gt;Note, that FreeAndNil is still not enough to fully cover those bad cases - because you can access one object through multiply variables. FreeAndNil will clear one reference, but it won’t touch others. A good example here is all kinds of lists of objects.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;3. &lt;em&gt;There is no need for FreeAndNil here!&lt;/em&gt; (i.e.: local variables)&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Well, local variable can be refactored into global later. FreeAndNil will protect you from misuses (just Free is not). Large amount of code is done by using copy-paste. That is why someone can pick your code, copy it into another place (where variable has different scope or is used multiply times), then he’ll be in trouble - if you didn’t use FreeAndNil (and this “he” may be even you, but few months later). Besides, if you have large routine then you may just not notice, that you have used variable few times (for example - in cycle). By &lt;strong&gt;always using FreeAndNil you’ll make your code bullet-proof for modifications&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;Moreover, it is just convient, when you have FreeAndNil everywhere, instead of mix of Free/FreeAndNil. And you don’t even need to think about it: “gosh, should I put FreeAndNil here or just Free is enough?!!”.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;If you think that FreeAndNil is still overkill in certain case - then &lt;em&gt;why don’t you use Destroy call&lt;/em&gt;? Indeed, the Free is overkill in many situations too!&lt;br /&gt;&lt;br /&gt;Note, that object’s destructor is not called in 99% of Delphi’s code (a call to procedure is used instead). Then why don’t we take a step further and don’t use FreeAndNil instead? The benefit of using FreeAndNil is far greater then benefit from using Free instead of Destroy. Why? Well, if the first case &lt;em&gt;we got the protection from very tricky mistakes&lt;/em&gt; (like I said - it is not panacea, but still a good bonus). And in the second case you got only &lt;em&gt;ability to skip writing additional “if”&lt;/em&gt;. Why? Because if you call Destroy for nil-variable, you’ll get an AV &lt;strong&gt;immediately&lt;/strong&gt; (because Self = nil, so any access to object’s field will trigger an undoubted AV). So, there is no problem at all - you will fix the code instantly. Compare this with case, &lt;strong&gt;when your code silently produce wrong results&lt;/strong&gt;!&lt;br /&gt;&lt;br /&gt;Furthermore, you can not giveup for a bonus “less writing” by implementing a routine “F”, which simply calls FreeAndNil.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;4. &lt;em&gt;Using Free instead of Destroy is recommended by CodeGear! And I never heard of such recommendation for FreeAndNil.&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Well, we already examined arguments that Free -&amp;gt; FreeAndNil transition will have more benefits than (already happened) transition Destroy -&amp;gt; Free. Now, don’t you think that argument of not having official approval from CG does look quite dull?&lt;/p&gt;&lt;br /&gt;&lt;p&gt;5. &lt;em&gt;Nevertheless, majority of people (who heard about this idea) will continue to claim that this is still overkill.&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Why?&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The most called reason is the force of the habit: “I write Free automatically, even without thinking”.&lt;br /&gt;&lt;br /&gt;Well, actually, this argument is quite serious.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;By in this post, I want to show you that there are good reasons to reconsider/change this habbit. Of course, there should be a &lt;strong&gt;really&lt;/strong&gt; good reson for broking your habbits. And here it comes…&lt;/p&gt;&lt;br /&gt;&lt;p&gt;6. &lt;em&gt;Safety of your code.&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Many people says (and they, indeed, believe so) that experienced programmer can use FreeAndNil only in nessesary places. In all other cases there is no need to clear the object’s reference - so you can use Free.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;But that is so wrong: &lt;strong&gt;you can not know that&lt;/strong&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Imagine, that destructor of your object deletes its object-field by using Free (such common action, right?). The destructor for this sub-object calls a virtual method as part of its destruction process. This method can be empty in base class. Well, so far so good.&lt;br /&gt;&lt;br /&gt;Now, someone (or may be you, few months later) will take these classes and override this virtual method. Now he will call another (virtual) method, which belongs to your first mentioned object. And this method (may be also in yet another child class) will try to use already deleted field in your first object. Suppose that this access will run ok (i.e. memory manager do not release this memory yet), but the global state of the application will be damaged forever. Ooops.&lt;br /&gt;&lt;br /&gt;FreeAndNil will guard you from this situation (by raising 100% AV), and Free is not.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Why did I mention virtual methods here? That is why you cann’t say: “I know what I am doing - there is no need for FreeAndNil here”. As you can see - you can not know that! Yes, two of your base classes is all good with it, but the very usual code in child classes can lead to the darkest error in the entire class hierarchy. Yes, it is not actually &lt;em&gt;your&lt;/em&gt; fault (unless you are also responsible for child classes too), but shouldn’t your code be ideal? And, yes, there is a bug in child class (by calling inadmissible method), but how will you catch it? Without FreeAndNil it is very hard to do.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Okay, even if you still insist on putting FreeAndNil only, when it is nessesary - then we just gave an example, when it is simply not obvious. If you have a habbit of using Free, then &lt;em&gt;you can not even think about considering this case as worth adding FreeAndNil&lt;/em&gt;! That is where all problems come. You’ll just put Free call here (as usual) and go somewhere else. And then spend a few days for debugging this tiny, nasty problem later.&lt;br /&gt;&lt;br /&gt;By using FreeAndNil everywhere you’ll dispose those problems (should I put it there or not?) - just put it everywhere! Like I said: &lt;strong&gt;FreeAndNil - is a safety belts&lt;/strong&gt;. And &lt;em&gt;realizing it is the only thing left&lt;/em&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Summary: from my point of view - &lt;em&gt;the bonus of protection against fickle/implicit errors outweigh the need to change the habbit&lt;/em&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Why wait? Why don’t use FreeAndNil everywhere, starting today? If you’ll make this your habbit - then you lose nothing, but gain very powerful bonus.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Nevertheless, I suspect that many Delphi programmers, even if they admit this idea, won’t change their practice - just because “someone has said something”. They do not meet with this situation - then it do not exists. So they’ll wait until the bug strike them hard. I’ll repeat it again: FreeAndNil is a safety belt. It protect you from bugs, that not happens yet.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Remark: this long post is just my opinion - feel free to reject it, if you (still) don’t like it.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;When you reference an object via more than one reference, you can mistakenly use already disposed object or free the very same object twice. The FreeAndNil gives you protection only if you mistakenly use the object after its dispose, when you have only one reference.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So, even if you use FreeAndNil, you still need an additional checks. And if you have large project and suddenly changes all Free calls to FreeAndNil - then there are good chances then you’ll run into problems. You’ll probably detect many kind of misuses. To track down these problems you’ll need a tool.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Such checks can be found in EurekaLog. We will talk about its memory-related features in more details later (yes, about FastMM too), and now I want to give only brief overview.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Once enabled, this feature can detect a various memory misuse cases and report them through usual exception notification process in EL. Those cases includes double-free and writes to already freed memory. Similar features are very common in advanced memory managers (like FastMM, for example).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;It is quite powerful feature, but just don’t forget that EurekaLog is a debugging tool. It is not essential part of Delphi language. You should not write code, which relies on its presence. I.e. you should not forget about FreeAndNil, hoping that EurekaLog will handle all bad cases for you. Besides, there still can be complex (and, actually, rare) situations, when EurekaLog’s features can not catch attempt of invalid memory access (it is not limitation of EL, the same is correct for other tools too). More on this topic later.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Apart from using FreeAndNil and diagnostic features in EurekaLog or MM, you should try to minimize references to each objects and try to use some sort of automatic management. For example, if your object can be included in the list, then it is good to add code, which removes object from any list it belongs to on deletion (there is an example in VCL - it is Components list-property).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Another approach is using interfaces with reference counting. Well, actually, you should be careful there: if you mix manual control of life-time (manual call to destructor) and automatic control (using reference counting in interfaces) - then things will go from bad to worse. But if you use only pure interfaces, then you’ll automatically get rid of such errors: compiler (well, your application at runtime) will look after your objects, not allowing their misuses.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-469098223257786389?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/469098223257786389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=469098223257786389' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/469098223257786389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/469098223257786389'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/why-should-you-always-use-freeandnil.html' title='Why should you always use FreeAndNil instead of Free'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-2071172430776109300</id><published>2009-04-27T17:10:00.000-07:00</published><updated>2009-04-27T17:11:40.203-07:00</updated><title type='text'>Storing Resource (WAV, MP3, ...) into Delphi Executables</title><content type='html'>&lt;div id="articlebody"&gt;Games and other types of applications which use multimedia files like sounds and animations must either distribute the extra multimedia files along with the application or embed the files within the executable.&lt;br /&gt;Rather than distribute separate files for your application's use, you can add the raw data to your application as a resource. You can then retrieve the data from your application when it is needed. This technique is generally more desirable because it can keep others from manipulating those add-in files.&lt;br /&gt;&lt;p&gt;This article will show you &lt;b&gt;how to embed (and use) sound files, video clips, animations and more generally any kind of binary files in a Delphi executable&lt;/b&gt;. For the most general purpose you'll see how to put a MP3 file inside a Delphi exe.&lt;br /&gt;&lt;h3&gt;Resource Files (.RES)&lt;/h3&gt;In the "Resource Files Made Easy" article you were presented with several examples of the use of bitmaps, icons and cursors from resources. As stated in that article we can use the Image Editor to create and edit resources that consist of such types of files. Now, when we are interested in storing various types of (binary) files inside a Delphi executable we'll have to deal with resource script files (.rc), the &lt;b&gt;Borland Resource Compiler&lt;/b&gt; tool and other.&lt;br /&gt;&lt;p&gt;Including several binary files in your executable consists of 5 steps:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Create and/or collect all the files you whish to put in an exe,&lt;br /&gt;&lt;li&gt;Create a resource script file (.rc) that describes those resources used by your application,&lt;br /&gt;&lt;li&gt;Compile the resource script file (.rc) file to create a resource file (.res),&lt;br /&gt;&lt;li&gt;Link the compiled resource file into the application’s executable file,&lt;br /&gt;&lt;li&gt;Use individual resource element. &lt;/li&gt;&lt;/ol&gt;The first step should be simple, simply decide what types of files you would like to store in you executable. For example, we will store two .wav songs, one .ani animations and one .mp3 song.&lt;br /&gt;&lt;p&gt;Before we move on, here are a few important statements concerning limitations when working with resources:&lt;br /&gt;&lt;p&gt;a) Loading and unloading resources is not a time consuming operation. Resources are part of the applications executable file and are loaded at the same time the application runs.&lt;br /&gt;&lt;p&gt;b) All the (free) memory can be used when loading/unloading resources. In other words there are no limits on number of resources loaded at the same time.&lt;br /&gt;&lt;p&gt;c)Of course, resource file do double the size of an executable. If you want smaller executable consider placing resources and parts of your project in DLLs and Packages.&lt;br /&gt;&lt;p&gt;Let's now see how to create a file that describes resources.&lt;br /&gt;&lt;h3&gt;Creating a Resource Script File (.RC)&lt;/h3&gt;A resource script file is a just a simple text file with the extension .rc that lists resources. The script file is in this format:&lt;br /&gt;&lt;blockquote class="no"&gt;ResName1 ResTYPE1 ResFileName1&lt;br /&gt;ResName2 ResTYPE2 ResFileName2&lt;br /&gt;...&lt;br /&gt;ResNameX ResTYPEX ResFileNameX&lt;br /&gt;... &lt;/blockquote&gt;&lt;i&gt;RexName&lt;/i&gt; specifies either a unique name or an integer value (ID) that identifies the resource. &lt;i&gt;ResType&lt;/i&gt; describes the type of resource and the &lt;i&gt;ResFileName&lt;/i&gt; is the full path and file name to the individual resource file.&lt;br /&gt;&lt;p&gt;To create a new resource script file, simply do the following:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Create a new text file in your projects directory.&lt;br /&gt;&lt;li&gt;Rename it to AboutDelphi.rc. &lt;/li&gt;&lt;/ol&gt;In the AboutDelphi.rc file, have the following lines:&lt;br /&gt;&lt;blockquote class="yes"&gt;Clock WAVE "c:\mysounds\projects\clock.wav"&lt;br /&gt;MailBeep WAVE "c:\windows\media\newmail.wav"&lt;br /&gt;Cool AVI cool.avi&lt;br /&gt;Intro RCDATA introsong.mp3&lt;br /&gt;&lt;/blockquote&gt;The script file simply defines resources. Following the given format the AboutDelphi.rc script lists two .wav files, one .avi animation, and one .mp3 song. All statements in a .rc file associate an identifying name, type and file name for a given resource. There are about a dozen predefined resource types. These include icons, bitmaps, cursors, animations, songs, etc. The RCDATA defines generic data resources. RCDATA let you include a raw data resource for an application. Raw data resources permit the inclusion of binary data directly in the executable file. For example, the RCDATA statement above names the application’s binary resource Intro and specifies the file introsong.mp3, which contains the song for that mp3 file.&lt;br /&gt;&lt;p&gt;Note: make sure you have all the resources you list in your .rc file available. If the files are inside your projects directory you don't have to include full file name. In my .rc file .wav songs are located *somewhere* on the disk and both the animation and mp3 song are located in the project's directory.&lt;br /&gt;&lt;h3&gt;Creating a Resource File (.RES)&lt;/h3&gt;To use the resources defined in the resource script file, we must compile it to a .res file with the Borland's Resource Compiler. The resource compiler creates a new file based on the contents of the resource script file. This file usually has an .res extension. The Delphi linker will later reformat the .res file into a resource object file and then link it to the executable file of an application.&lt;br /&gt;&lt;p&gt;The Borland's Resource Compiler command line tool is located in the Delphi Bin directory. The name is BRCC32.exe. Simply go to the command prompt and type brcc32 then press Enter. Since the Delphi\Bin directory is in your Path the Brcc32 compiler is invoked and displays the usage help (since it was called with no parapeters).&lt;br /&gt;&lt;p&gt;To compile the AboutDelphi.rc file to a .res file execute this command at the command prompt (in the projects directory):&lt;br /&gt;&lt;blockquote class="no"&gt;BRCC32 AboutDelphi.RC &lt;/blockquote&gt;By default, when compiling resources, BRCC32 names the compiled resource (.RES) file with the base name of the .RC file and places it in the same directory as the .RC file.&lt;br /&gt;&lt;p&gt;You can name the resource file anything you want, as long as it has the extension ".RES" and the filename without the extension is not the same as any unit or project filename. This is important, because by default, each Delphi project that compiles into an application has a resource file with the same name as the project file, but with the extension .RES. It's best to save the file to the same directory as your project file. &lt;!--/gc--&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-2071172430776109300?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/2071172430776109300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=2071172430776109300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2071172430776109300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2071172430776109300'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/storing-resource-wav-mp3-into-delphi.html' title='Storing Resource (WAV, MP3, ...) into Delphi Executables'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-7364575326894340407</id><published>2009-04-27T17:05:00.000-07:00</published><updated>2009-04-27T17:09:22.276-07:00</updated><title type='text'>Create Manifest for Vista UAC if Not Running Under Administrative Rights</title><content type='html'>From a developer perspective Windows Vista's UAC can be problematic for some parts of your Delphi application, if the application is not being run by an administartor. One such operation is writing to the Registry database.&lt;br /&gt;&lt;br /&gt;Learn how to "request admin rights" by creating an application manifest file....&lt;br /&gt;&lt;br /&gt;Windows Vista - User Account Control&lt;br /&gt;User Account Control is a security component in Windows Vista. UAC enables users to perform common tasks as non-administrators, called standard users in Windows Vista, and as administrators without having to switch users, log off, or use Run As.&lt;br /&gt;To help prevent malicious software from silently installing and causing computer-wide infection, Microsoft developed the UAC feature.&lt;br /&gt;&lt;br /&gt;From a developer perspective the following UAC features are important:&lt;br /&gt;&lt;br /&gt;All processes are started as Standard User as default&lt;br /&gt;A Standard User can not:&lt;br /&gt;Change files in Program Files folders&lt;br /&gt;Change files in Windows or System32 folders&lt;br /&gt;Change registry under HKLM\Software&lt;br /&gt;Change the local machines date and time&lt;br /&gt;...the list continues...&lt;br /&gt;Programmatically Edit Registry to Run Your Delphi Application on Windows Startup&lt;br /&gt;By programmatically editing the Windows Registry, using the TRegistry object, you can you can "automagically" start programs whenever Windows launches.&lt;br /&gt;The procedure you can use to force "auto-run-on-Windows-startup" for your application might look like:&lt;br /&gt;&lt;br /&gt;&lt;blockquote class="yes"&gt;&lt;b&gt;procedure&lt;/b&gt; RunOnStartup(&lt;b&gt;const&lt;/b&gt; sCmdLine: string; bRunOnce: boolean = false; Remove: Boolean = false) ;&lt;br /&gt;&lt;b&gt;var&lt;/b&gt;&lt;br /&gt;sKey: string;&lt;br /&gt;Section: string;&lt;br /&gt;&lt;b&gt;const&lt;/b&gt;&lt;br /&gt;ApplicationTitle = ”Your Application TITLE”;&lt;br /&gt;&lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;&lt;b&gt;if&lt;/b&gt; (bRunOnce) &lt;b&gt;then&lt;/b&gt;&lt;br /&gt;sKey := 'Once'&lt;br /&gt;&lt;b&gt;else&lt;/b&gt;&lt;br /&gt;sKey := '';&lt;br /&gt;&lt;br /&gt;Section := 'Software\Microsoft\Windows\CurrentVersion\Run' + sKey + #0;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;with&lt;/b&gt; TRegIniFile.Create('') &lt;b&gt;do&lt;/b&gt;&lt;br /&gt;&lt;b&gt;try&lt;/b&gt;&lt;br /&gt;RootKey := HKEY_LOCAL_MACHINE;&lt;br /&gt;&lt;b&gt;if&lt;/b&gt; Remove &lt;b&gt;then&lt;/b&gt;&lt;br /&gt;DeleteKey(Section, ApplicationTitle)&lt;br /&gt;&lt;b&gt;else&lt;/b&gt;&lt;br /&gt;WriteString(Section, ApplicationTitle, sCmdLine) ;&lt;br /&gt;&lt;b&gt;finally&lt;/b&gt;&lt;br /&gt;Free;&lt;br /&gt;&lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;On &lt;b&gt;Vista&lt;/b&gt;, if the user running the application does &lt;b&gt;not have admin rights&lt;/b&gt; the above code would &lt;b&gt;fail&lt;/b&gt;, due to UAC!&lt;br /&gt;&lt;h3&gt;Faking UAC Rights - How to Request Execution Level&lt;/h3&gt;Even if the user running the above code is not an admin, you can, as a developer arm your application with a special kind of embedded resource: &lt;b&gt;application manifest file&lt;/b&gt;.&lt;br /&gt;&lt;p&gt;Having the manifest file will ensure Vista's UAC will allow your code to execute.&lt;br /&gt;&lt;p&gt;Here are the steps:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Create XML file with following content:&lt;br /&gt;&lt;blockquote class="yes"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;br /&gt;&amp;lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0]&lt;br /&gt; &amp;lt;assemblyIdentity version="1.1.1.1"&lt;br /&gt;  processorArchitecture="X86"&lt;br /&gt;  name="YourApplicationExeName"&lt;br /&gt;  type="win32"/&amp;gt;&lt;br /&gt; &amp;lt;description&amp;gt;elevate execution level&amp;lt;/description&amp;gt;&lt;br /&gt; &amp;lt;trustInfo xmlns="urn:schemas-microsoft-com:asm.v2]&lt;br /&gt; &amp;lt;security&amp;gt;&lt;br /&gt;  &amp;lt;requestedPrivileges&amp;gt;&lt;br /&gt;   &amp;lt;requestedExecutionLevel level="requireAdministrator" uiAccess="false"/&amp;gt;&lt;br /&gt;  &amp;lt;/requestedPrivileges&amp;gt;&lt;br /&gt; &amp;lt;/security&amp;gt;&lt;br /&gt; &amp;lt;/trustInfo&amp;gt;&lt;br /&gt;&amp;lt;/assembly&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;li&gt;Name this XML file as YourApplicationName.manifest&lt;br /&gt;&lt;li&gt;Create a text file with following content:&lt;br /&gt;&lt;p&gt;1 24 "YourApplicationName.manifest" &lt;/p&gt;&lt;br /&gt;&lt;li&gt;Name this text file as YourApplicationName.RC&lt;br /&gt;&lt;li&gt;using the command line execute following command:&lt;br /&gt;&lt;p&gt;brcc32 YourApplicationName.RC -foYourApplicationName.REC&lt;br /&gt;&lt;p&gt;This will create a new resource file called YourApplicationName.REC &lt;/p&gt;&lt;br /&gt;&lt;li&gt;Copy this YourApplicationName.REC file in to the resource path of your application.&lt;br /&gt;&lt;li&gt;Include this resource file into the DPR of you application, as like:&lt;br /&gt;&lt;p&gt;{$R YourApplicationName.REC} &lt;/p&gt;&lt;br /&gt;&lt;li&gt;Finally build your application - it is now ready to get admin rights on Windows Vista. &lt;/li&gt;&lt;/ol&gt;Note 1: in the above steps, replace "YourApplicationExeName" with your actual application name.&lt;br /&gt;&lt;p&gt;Note 2: Above steps create a resource file to be stored inside the EXE file of your application. More on &lt;a href="http://delphi.about.com/c/ec/56.htm"&gt;&lt;/a&gt;.&lt;br /&gt;&lt;h3&gt;How to Automate the Above "Create Manifest" Process&lt;/h3&gt;To help you automate the process I have written a small program that does all the dirty work for you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-7364575326894340407?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/7364575326894340407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=7364575326894340407' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/7364575326894340407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/7364575326894340407'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/create-manifest-for-vista-uac-if-not.html' title='Create Manifest for Vista UAC if Not Running Under Administrative Rights'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-7637905875068422711</id><published>2009-04-27T17:02:00.001-07:00</published><updated>2009-04-27T17:02:43.922-07:00</updated><title type='text'>Getting Started with Delphi and C++Builder 2009</title><content type='html'>As someone who hires people to document RAD Studio, one of my challenges has been to find training materials for the brand new user. There are excellent sources for experienced users, but the fresh graduate who may have learned C or Java in school did not find a lot of help for learning the latest RAD Studio.&lt;br /&gt;&lt;br /&gt;To remedy this, my team put together a new Getting Started guide that describes the UI and a few language basics. Led by Alex Ciobanu, tech writer Lucian Bentea and editor Denisa Ilascu authored the book with the able assistance of Andrei Susnea (on C++Builder) and Alex (on Delphi). Reviewers Kris Houser, Gary Staas, and Tim del Chario gave good feedback. Raluca Dudau was our first "new user test driver" and proved the point that a good training experience sets the basis for future success.&lt;br /&gt;&lt;br /&gt;This book will be followed by a series of language guides the team is currently writing, in between their work on new features and perennial updates to the VCL/RTL.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-7637905875068422711?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/7637905875068422711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=7637905875068422711' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/7637905875068422711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/7637905875068422711'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/getting-started-with-delphi-and.html' title='Getting Started with Delphi and C++Builder 2009'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-4458193681040688769</id><published>2009-04-26T18:35:00.000-07:00</published><updated>2009-04-26T18:36:00.627-07:00</updated><title type='text'>Hint for Delphi Prism</title><content type='html'>&lt;strong&gt;Why is it all in English? Can I switch the language? Why does the IDE sometimes use multiple languages?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In a recent workshop Olaf Monien and I held together, the question came up if there was a German version for Delphi Prism. Furthermore, people asked us how to switch the language if possible.&lt;br /&gt;&lt;br /&gt;Well, Embarcadero provides English, German, French and Japanese translations for Prism. However, the language cannot be selected, because it is determined by the language of the Visual Studio IDE that Prism is being installed into.&lt;br /&gt;&lt;br /&gt;Thus, if you have an English version of Visual Studio, Prism will also be in English. Consequently, you will need to install the German version of Visual Studio in order to use the German localization of Prism.&lt;br /&gt;&lt;br /&gt;Personally, I am also not very happy with this solution as I would like to be able to switch the languages as well. I solved the issue by using two virtual machines.&lt;br /&gt;&lt;br /&gt;Finally, regarding the last issue mentioned in the caption, a lot of messages being shown inside the IDE are taken from resources inside the .NET framework. The framework is independent from Visual Studio and can be in a different language. Thus, if you have not installed the .NET German language package , the error messages for all exceptions thrown by the framework will be in English (or in the language that a language package has been installed for). As Visual Studio uses MS Build to compile or build .NET projects, these messages will always be taken from the framework. This is frequently the first time one notices that the framework is missing a language package when you are running inside a German Visual Studio IDE and the compiler messages are all in English.&lt;br /&gt;&lt;br /&gt;To sum it up, one has to be very considerate which products and language packages one installs in order to end up with the development environment in a language one wants to work in.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-4458193681040688769?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/4458193681040688769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=4458193681040688769' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4458193681040688769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4458193681040688769'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/hint-for-delphi-prism.html' title='Hint for Delphi Prism'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-4093382983111330526</id><published>2009-04-25T20:05:00.000-07:00</published><updated>2009-04-25T20:06:26.379-07:00</updated><title type='text'>Generic Methods and Type Inferencing</title><content type='html'>&lt;div class="content"&gt;&lt;p&gt;In other words - as I understand it - Tiburón/Delphi 2009 will not (initially at least) support type inferencing.  To my mind this dramatically reduces the attractiveness of Generic Methods.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What Is Type Inferencing?&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;As the term suggests, (in this context at least) it is the ability of the compiler to infer the type of some symbol (variable or parameter etc) from the context or code around it.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In C# for example, it means that variables can be declared:&lt;/p&gt;&lt;br /&gt;&lt;pre class="csharp"&gt;  var a = 10;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The compiler will infer from this that the type of variable &lt;strong&gt;a&lt;/strong&gt; is &lt;strong&gt;int&lt;/strong&gt; (you knew that, right?) without this having to be explicitly declared.&lt;/p&gt;&lt;br /&gt;&lt;p style="PADDING-LEFT: 30px"&gt;&lt;strong&gt;Pop Quiz:&lt;/strong&gt; What do we think would/should the type of &lt;strong&gt;a&lt;/strong&gt; be if Delphi were to support this?&lt;/p&gt;&lt;br /&gt;&lt;p style="PADDING-LEFT: 30px"&gt;&lt;em&gt;Hint: What type would &lt;strong&gt;a&lt;/strong&gt; be if it were a constant?&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In general I find this to have dubious value, what, for example, can you deduce about the correct usage of &lt;strong&gt;a&lt;/strong&gt; from this:&lt;/p&gt;&lt;br /&gt;&lt;pre class="csharp"&gt;  var a = someRef.DisplayValue;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;To know the type of &lt;strong&gt;a&lt;/strong&gt; you know need to know the type of &lt;strong&gt;someRef&lt;/strong&gt; in order to in turn know the return type of &lt;strong&gt;DisplayValue&lt;/strong&gt;.  If browsing a project with all references intact and &lt;em&gt;Code Insight&lt;/em&gt;, or equivalent, to deliver this information to you, then all good.  But if not, you are going to have a sticky time of it, and either way you still have to trust that the person that wrote the code - which perhaps wasn’t you - also knew those things and didn’t make their own inferencing error.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;But what does type inferencing have to do with Generic Methods?&lt;/p&gt;&lt;br /&gt;&lt;p&gt;To understand that let’s look at why Generic Methods even come into it.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;It all started this evening when I found myself needing to add another overload to my set of &lt;strong&gt;Exchange()&lt;/strong&gt; methods, two of which I show here to give you the idea:&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;  procedure Exchange(var A, B: Integer); overload;&lt;br /&gt;  procedure Exchange(var A, B: TObject); overload;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;(The &lt;strong&gt;Exchange&lt;/strong&gt; procedure exchanges the values of the two passed parameters)&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;My problem was that because the parameters to these procedures are, by necessity, &lt;strong&gt;var&lt;/strong&gt; parameters, the compiler enforces strict type checking, so the second of the above declarations cannot be used with variables of a &lt;strong&gt;TObject&lt;/strong&gt; &lt;em&gt;derived&lt;/em&gt; type, but only variables explicitly and specifically of &lt;strong&gt;TObject&lt;/strong&gt; type itself:&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;  var&lt;br /&gt;    obj1, obj2: TObject;&lt;br /&gt;    form1, form2: TForm;&lt;br /&gt;  begin&lt;br /&gt;    :&lt;br /&gt;    Exchange(obj1, obj2); // OK - references will be exchanged&lt;br /&gt;    Exchange(form1, form2); // ERROR: No compatible overload&lt;br /&gt;  end;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The second call to &lt;strong&gt;Exchange()&lt;/strong&gt; will not compile because the &lt;strong&gt;TForm&lt;/strong&gt; type parameters are not compatible (from the compiler’s perspective) with the &lt;strong&gt;TObject&lt;/strong&gt; overloaded version of the routine.  I have to add another overload with explicitly &lt;strong&gt;TForm&lt;/strong&gt; type parameters.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Not for the first time recently I found myself thinking “If only I had Delphi 2009 - Generic Methods would make this so much easier!”.  Then I remembered reading Barry Kelly’s note about lack of type inferencing in Delphi 2009, and an alarm bell started ringing.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;The Generic Solution&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;A generic implementation of an &lt;strong&gt;Exchange()&lt;/strong&gt; procedure should be simple enough, and would go a little something like this:&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;  procedure Exchange&amp;lt;T&amp;gt;(var A, B: T);&lt;br /&gt;  var&lt;br /&gt;    i: T;&lt;br /&gt;  begin&lt;br /&gt;    i := A;&lt;br /&gt;    A := B;&lt;br /&gt;    B := i;&lt;br /&gt;  end;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Which is nice and neat and cuts down on all those overloads. Unfortunately however, &lt;span style="TEXT-DECORATION: underline"&gt;using&lt;/span&gt; this procedure is actually now more cumbersome, not less:&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;  var&lt;br /&gt;    obj1, obj2: TObject;&lt;br /&gt;    form1, form2: TForm;&lt;br /&gt;  begin&lt;br /&gt;    :&lt;br /&gt;    Exchange&amp;lt;TObject&amp;gt;(obj1, obj2);&lt;br /&gt;    Exchange&amp;lt;TForm&amp;gt;(form1, form2);&lt;br /&gt;  end;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Ouch.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Frankly for the time it takes to create a new overload of a trivial routine like this, I would rather take those few seconds and reap the rewards later since - in common with most such routines - the code for the procedure will be written only once but code to call it will be written many, many times.&lt;/p&gt;&lt;br /&gt;&lt;p style="PADDING-LEFT: 30px"&gt;&lt;em&gt;Voices Off:&lt;/em&gt; “But lots of overloads will pollute your namespace!”&lt;/p&gt;&lt;br /&gt;&lt;p&gt;You know what? That bothers me a lot less than creating unnecessary work for myself. I’m not the sort of developer that is unable to produce a line of code without invoking &lt;em&gt;Code Completion&lt;/em&gt;. I may be unusual in this day and age, but I still &lt;span style="TEXT-DECORATION: underline"&gt;write&lt;/span&gt; code faster than I can pick it from drop-down lists.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;And this in Win32 Delphi at least is surely the biggest impact?  As far as the code goes,  any unused overloads will be pruned out by the linker.  In .NET - aiui - a cluttered namespace becomes a public nuisance, so the imperatives are somewhat different perhaps.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;How Would Type Inferencing Help?&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Well, assuming that any future Delphi type inferencing system could determine the appropriate type from the parameters (as it can in C#) then we could invoke our generic &lt;strong&gt;Exchange&amp;lt;T&amp;gt;()&lt;/strong&gt; method by simply writing:&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;  var&lt;br /&gt;    obj1, obj2: TObject;&lt;br /&gt;    form1, form2: TForm;&lt;br /&gt;  begin&lt;br /&gt;    :&lt;br /&gt;    Exchange(obj1, obj2);&lt;br /&gt;    Exchange(form1, form2);&lt;br /&gt;  end;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;i.e. just as we can do with overloads.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;But until this is possible at this stage I was feeling that I would continue with overloads until - at least - type inferencing were available.  They are just as type-safe and ironically produce “consumer” code that should be entirely compatible with a future generic methods implementation that &lt;em&gt;is&lt;/em&gt; bolstered by type inferencing.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Using generic methods &lt;span style="TEXT-DECORATION: underline"&gt;without&lt;/span&gt; type inferencing (in these sorts of cases at least) will simply create unnecessarily verbose and cumbersome “consumer” code.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;But not being one to give in, I considered some alternative approaches.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;A Truly generic Approach?&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Alternatively, Delphi already provides a means to implement a truly generic (lower case “g’) &lt;strong&gt;Exchange()&lt;/strong&gt; method - untyped parameters:&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;  procedure Exchange(var A, B);&lt;br /&gt;  var&lt;br /&gt;    i: ?&lt;br /&gt;  begin&lt;br /&gt;    i := A;&lt;br /&gt;    A := B;&lt;br /&gt;    B := i;&lt;br /&gt;  end;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;You will immediately notice of course that this implementation is neither valid nor complete. The type of &lt;strong&gt;i&lt;/strong&gt; (for “intermediate”, if you were wondering) is not known and indeed not knowable.  And furthermore, the compiler simply won’t accept that &lt;strong&gt;A := B&lt;/strong&gt; assignment since it doesn’t know the types of &lt;strong&gt;A&lt;/strong&gt; and &lt;strong&gt;B&lt;/strong&gt; it cannot know what instructions are needed.  For the same reason, &lt;a href="http://en.wikipedia.org/wiki/XOR_swap_algorithm" target="_blank"&gt;the XOR trick&lt;/a&gt; won’t work either.  Those untyped parameters seem to have lead us to a dead end.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Not quite.  (If you are squeamish and/or don’t like smelly code you might want to avert your gaze about now, or at least pinch your nose):&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;  procedure Exchange(var A, B);&lt;br /&gt;  var&lt;br /&gt;    aa: Integer absolute A;&lt;br /&gt;    bb: Integer absolute B;&lt;br /&gt;    i: Integer;&lt;br /&gt;  begin&lt;br /&gt;    i  := aa;&lt;br /&gt;    aa := bb;&lt;br /&gt;    bb := i;&lt;br /&gt;  end;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The &lt;strong&gt;absolute&lt;/strong&gt; keyword is not something to be used lightly - it tells the compiler that the variables &lt;strong&gt;aa&lt;/strong&gt; and &lt;strong&gt;bb&lt;/strong&gt; exist at the same location as the parameters &lt;strong&gt;A&lt;/strong&gt; and &lt;strong&gt;B&lt;/strong&gt; - in this case the compiler even takes care of the fact that the parameters are passed by reference.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Since the variables are typed and the parameters are untyped, how can this be safe?&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Well, frankly it isn’t.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In practice if the type of &lt;strong&gt;A&lt;/strong&gt; and &lt;strong&gt;B&lt;/strong&gt; is not the same size as an &lt;strong&gt;Integer&lt;/strong&gt; (32-bits) then things are not going to go at all according to plan.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Equally of course though, if you only ever call this implementation routine with 32-bit sized parameters (which includes strings, object references etc) there won’t be a problem.  “IF”.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I should point out at this stage that I explored this approach as a curiosity.  I am certainly NOT recommending it!  For one thing it is not “truly generic” at all - it only appears to be but in fact has fairly strict conditions for correct use, and does not benefit from any assistance from the compiler to ensure that you do in fact use it correctly!&lt;/p&gt;&lt;br /&gt;&lt;p&gt;But we have one more trick up our sleeve - there is (at least) one more way to skin this particular cat that is safer than an untyped parameter approach and only a little more cumbersome to use than a non-type-inferenced Generic approach.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;X-Rated Code - Being Explicit&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;A &lt;strong&gt;var&lt;/strong&gt; parameter is syntactic sugar for passing by referencing and allowing modification of the de-referenced value.  We can of course achieve the same thing by taking care of the de-referencing aspects ourselves and explicitly passing references to values, rather than the values themselves:&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;  type&lt;br /&gt;    PObject = ^TObject;&lt;br /&gt;&lt;br /&gt;   :&lt;br /&gt;&lt;br /&gt;  procedure Exchange(const A, B: PObject);&lt;br /&gt;  var&lt;br /&gt;    i: TObject&lt;br /&gt;  begin&lt;br /&gt;    i  := A^;&lt;br /&gt;    A^ := B^;&lt;br /&gt;    B^ := i;&lt;br /&gt;  end;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;And to call this:&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;  var&lt;br /&gt;    obj1, obj2: TObject;&lt;br /&gt;    form1, form2: TForm;&lt;br /&gt;  begin&lt;br /&gt;    :&lt;br /&gt;    Exchange(@obj1, @obj2);&lt;br /&gt;    Exchange(@form1, @form2);&lt;br /&gt;  end;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;All of which sits happily alongside any other overloaded versions of &lt;strong&gt;Exchange()&lt;/strong&gt;, but which unfortunately requires consumer code that will not be compatible with a future Generic Method implementation of the routine.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;BUT, even this won’t work if we are compiling with &lt;strong&gt;Typed @ Operator&lt;/strong&gt; option enabled.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So I’m left a little stumped.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;There are many ways to go about this.  If it weren’t for the fact that Generic Methods are nearly upon us I would favour the explicit de-referencing approach.  But the desire to create code today that will be compatible with impending new language features is quite compelling.  Then again, until we also get type inferencing, a Generic Methods based approach isn’t going to be compatible with &lt;span style="TEXT-DECORATION: underline"&gt;anything&lt;/span&gt; we can write today anyway.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Despite myself, the untyped parameter approach could yet prove too tempting to resist (particularly if I find myself needing yet another class-specific version of &lt;strong&gt;Exchange()&lt;/strong&gt;) since all the types that I’ve ever found myself wanting to &lt;strong&gt;Exchange()&lt;/strong&gt; meet the 32-bit criteria.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;It really hinges on when we might see type inferencing in a Delphi compiler.  If that is something we are likely only to see in &lt;a href="http://dn.codegear.com/article/36620" target="_blank"&gt;Commodore&lt;/a&gt; then worrying about compatability of a few calls to Exchange() could prove somewhat misplaced given the far wider issues likely to arise from the move to a 64-bit compiler.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;A Compromise?&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;In the meantime I wonder whether it would not be possible to have a compiler option to disable such strict type checking on var parameters, ideally on a method-by-method basis.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;After all, we still have such an option for short string var parameters (although having never had cause to use it I don’t know if it works in quite the way I have in mind - i.e. on declarations of rather than calls to, methods).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In the case of class-type var parameters the more relaxed type checking could allow parameters of any type correctly derived from the formal type:&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;  interface&lt;br /&gt;    {$VARSTRICTCLASSTYPE OFF}&lt;br /&gt;    procedure Exchange(var A, B: TObject);&lt;br /&gt;    {$VARSTRICTCLASSTYPE ON}&lt;br /&gt;&lt;br /&gt;  implementation&lt;br /&gt;&lt;br /&gt;    procedure Exchange(var A, B: TObject);&lt;br /&gt;      :&lt;br /&gt;    end;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Then again, I can’t think of any other concrete examples where such a capability would have any practical use.  But if this were possible to implement more quickly and safely than a comprehensive type inferencing system, I think I’d take it to keep me going.&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-4093382983111330526?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/4093382983111330526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=4093382983111330526' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4093382983111330526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4093382983111330526'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/generic-methods-and-type-inferencing.html' title='Generic Methods and Type Inferencing'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-8995229259639780620</id><published>2009-04-25T20:01:00.000-07:00</published><updated>2009-04-25T20:02:21.046-07:00</updated><title type='text'>Proposal for Automated Variables</title><content type='html'>&lt;div class="content"&gt;&lt;p&gt;Yesterday I logged a Quality Central report proposing the addition of support for “automatic variables” to the Delphi language.  Not only is it an &lt;span style="TEXT-DECORATION: underline"&gt;excellent&lt;/span&gt; idea (in my humble and utterly objective opinion :)), but there is already a keyword in the language that could be co-opted for this purpose, a keyword that has been at something of a loose-end since it was deprecated (rendered obsolete even) a long, long time ago…&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The language keyword in question is &lt;strong&gt;automated&lt;/strong&gt;.  This was introduced in Delphi 2.0 as part of the initial implementation to support COM automation and, if memory serves, deprecated in the very next release when “proper” (albeit COM) interfaces were added to the language.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The functionality that &lt;strong&gt;AutoFree()&lt;/strong&gt; provides is similar to the concept of an &lt;a href="http://en.wikipedia.org/wiki/Auto_ptr" target="_blank"&gt;auto pointer&lt;/a&gt; - a specific variant of the general concept of a &lt;a href="http://en.wikipedia.org/wiki/Smart_pointer" target="_blank"&gt;smart pointer&lt;/a&gt;.  “auto”… “automatic”… “automated”… the similarity in the terms, and the relevance of the semantics, is striking.  To me at least.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The proposal in Quality Central drew inspiration directly from exchanges in the comments on my post on an &lt;strong&gt;AutoFree()&lt;/strong&gt; implementation and a realisation that the required behaviour is very similar to that already implemented for interface references - it would not be entirely alien to the Delphi language.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Indeed I believe it would be quite easily understood and welcomed by most, if not all, developers.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;The Proposal&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;The &lt;strong&gt;automated&lt;/strong&gt; keyword should be supported as a decoration on variable declarations.  That is local variables, member variables and unit variables:&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;interface&lt;br /&gt;&lt;br /&gt;  type&lt;br /&gt;    TFoo = class&lt;br /&gt;    private&lt;br /&gt;      fBar: TBar automated;&lt;br /&gt;    end;&lt;br /&gt;&lt;br /&gt;implementation&lt;br /&gt;&lt;br /&gt;  var&lt;br /&gt;    _Bar: TBar automated;&lt;br /&gt;&lt;br /&gt;  function FooFn;&lt;br /&gt;  var&lt;br /&gt;    bar: TBar automated;&lt;br /&gt;  begin&lt;br /&gt;    :&lt;br /&gt;  end;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The rules for the keyword and the effect of it shall be as follows:&lt;/p&gt;&lt;br /&gt;&lt;p style="PADDING-LEFT: 30px"&gt;- The &lt;strong&gt;automated&lt;/strong&gt; keyword shall be valid only for pointer and object reference type variables. &lt;strong&gt;(*)&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="PADDING-LEFT: 30px"&gt;- When marked as &lt;strong&gt;automated&lt;/strong&gt; the compiler shall emit code to initialize a variable to &lt;strong&gt;NIL&lt;/strong&gt;. &lt;em&gt;This already occurs for local variables of certain types, most notably interface references, as well as all member variables &lt;/em&gt;&lt;em&gt;(albeit indirectly in that case)&lt;/em&gt;&lt;em&gt;, and currently has to be specified directly, if required, for unit variables.&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="PADDING-LEFT: 30px"&gt;- When marked as &lt;strong&gt;automated&lt;/strong&gt; the compiler shall emit code to finalize a variable in a manner appropriate to it’s type.  For object references this shall be a call to &lt;strong&gt;Free&lt;/strong&gt;; for pointers a call to &lt;strong&gt;FreeMem()&lt;/strong&gt;.  &lt;em&gt;This is directly equivalent to the code already emitted by the compiler to finalize interface references by calling &lt;strong&gt;Release()&lt;/strong&gt;.&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="PADDING-LEFT: 30px"&gt;- &lt;strong&gt;automated&lt;/strong&gt; would &lt;span style="TEXT-DECORATION: underline"&gt;not&lt;/span&gt; be combinable with &lt;strong&gt;absolute&lt;/strong&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;(*)&lt;/strong&gt; - it could also be supported on record types with the proviso that the record type in question supports a parameterless &lt;strong&gt;constructor&lt;/strong&gt; (to be called to initialize the record) and a lone &lt;strong&gt;destructor&lt;/strong&gt; (called to finalize the record).  But to keep things simple lets stick to object references and pointers, for now at least.&lt;br /&gt;&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The effect on code of the use of this keyword would be to facilitate:&lt;/p&gt;&lt;br /&gt;&lt;p style="PADDING-LEFT: 30px"&gt;1. resource protection for temporary objects held in local variables without the need for &lt;strong&gt;try..finally&lt;/strong&gt; blocks.&lt;/p&gt;&lt;br /&gt;&lt;p style="PADDING-LEFT: 30px"&gt;2. reliable clean up of dependent objects in object hierarchies without the need for objects to implement a &lt;strong&gt;destructor&lt;/strong&gt; (solely) to free those dependent objects.  Destructors may still be necessary for other purposes of course.&lt;/p&gt;&lt;br /&gt;&lt;p style="PADDING-LEFT: 30px"&gt;3. reliable clean up of unit (a.k.a “global”) objects without the need for a unit &lt;strong&gt;finalization&lt;/strong&gt;.  Again, finalization may still be required for other purposes.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Note however that it would not prevent these existing techniques from functioning, if required or preferred.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;There is only one possible danger that I foresee, which is that a developer might mark a variable as automated but then dispose of the referenced object/memory explicitly without re-initializing the variable.  e.g.:&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;  procedure SomeFn;&lt;br /&gt;  var&lt;br /&gt;    bar: TBar automated;&lt;br /&gt;  begin&lt;br /&gt;    bar := TBar.Create;&lt;br /&gt;    bar.Free;&lt;br /&gt;  end;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;In this case, when &lt;strong&gt;SomeFn&lt;/strong&gt; exits, the finalization of &lt;strong&gt;bar&lt;/strong&gt; will likely result in an error since &lt;strong&gt;bar&lt;/strong&gt; has been left holding a reference to an object that has already been &lt;strong&gt;Free&lt;/strong&gt;‘d.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Note that the initialization of &lt;strong&gt;bar&lt;/strong&gt; as NIL (as a consequence of being &lt;strong&gt;automated&lt;/strong&gt;) specifically avoids any problem if bar is only assigned a reference conditionally in the code.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Note also that explicitly disposing an automated variable is not in and of itself problematic, as long as the variable is also then explicitly re-set to &lt;strong&gt;NIL&lt;/strong&gt;.  In the above example, if bar had been &lt;strong&gt;NIL&lt;/strong&gt;‘d once freed, or &lt;strong&gt;FreeAndNIL()&lt;/strong&gt; had been used, then there would not be any problem with the automated behaviour of &lt;strong&gt;bar&lt;/strong&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The code below illustrates safe explicit disposal and potentially conditional assignment of an automated reference:&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;  procedure SomeFn;&lt;br /&gt;  var&lt;br /&gt;    bar: TBar automated;&lt;br /&gt;  begin&lt;br /&gt;    bar := TBar.Create;&lt;br /&gt;&lt;br /&gt;    // do some work with "bar"&lt;br /&gt;&lt;br /&gt;    FreeAndNIL(bar);&lt;br /&gt;&lt;br /&gt;    if SomeCondition then&lt;br /&gt;    begin&lt;br /&gt;      bar := TBar.Create;&lt;br /&gt;      // do more work with a new "bar"&lt;br /&gt;    end;&lt;br /&gt;  end;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;This code is perfectly safe, will not result in a runtime error and will not leak a &lt;strong&gt;TBar&lt;/strong&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The potential dangers and pitfalls of an automated variable behaviour implemented as described are actually no different to the potential dangers and pitfalls associated with the manual techniques that it could replace.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I should also mention that I cannot see that the proposal described here would necessarily interfere with, or be interfered with by, the existing, deprecated usage of the &lt;strong&gt;automated&lt;/strong&gt; keyword.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;A final observation is that this implementation “feels very Pascal’ly” to me.  In a &lt;span style="TEXT-DECORATION: underline"&gt;good&lt;/span&gt; way.&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-8995229259639780620?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/8995229259639780620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=8995229259639780620' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8995229259639780620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/8995229259639780620'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/proposal-for-automated-variables.html' title='Proposal for Automated Variables'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-1067167746746567441</id><published>2009-04-25T19:58:00.000-07:00</published><updated>2009-04-25T19:59:38.621-07:00</updated><title type='text'>Raising The Dead</title><content type='html'>&lt;div class="content"&gt;&lt;p&gt;What can possibly go wrong in the simple act of modifying the message of an exception to add some additional diagnostic information and then re-raising it?&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Quite a lot actually, and all from one simple mistake.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here’s a simplified version of a fairly common construct that you will encounter in Delphi code:&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;  var&lt;br /&gt;    a: Integer;&lt;br /&gt;  begin&lt;br /&gt;    try&lt;br /&gt;      a := 0;&lt;br /&gt;      Caption := IntToStr(100 div a);&lt;br /&gt;    except&lt;br /&gt;      on e: Exception do&lt;br /&gt;      begin&lt;br /&gt;        e.Message := 'Oops: ' + e.Message;&lt;br /&gt;        raise e;&lt;br /&gt;      end;&lt;br /&gt;    end;&lt;br /&gt;  end;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The intention is to add some additional diagnostic information to an exception message to assist in debugging (assuming it is not subsequently handled by some exception handler further up the stack), but without handling the exception itself. i.e. to re-raise the exception.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Fairly innocuous and entirely straightforward - most experienced Delphi developers can probably do this in their sleep.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Which is I think what happened here - sleep-coding I mean - because if you compile and run this code your exception handling will cause an apparent meltdown in your application. After the initial exception is reported - seemingly normally - you will then encounter access violations and even external exceptions.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Some of you may have spotted the problem already, but it took me 20 minutes of trying to figure out why such seemingly simple and harmless code was causing access violations and external exceptions etc etc.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;How can raising an exception do that? Perhaps the method was being invoked on an invalid instance or some other similar bad pointer was getting involved in the situation somehow (which was far more complex than this simplified version).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The problem of course lay in the mostly harmless looking:&lt;/p&gt;&lt;br /&gt;&lt;pre class="delphi"&gt;      raise e;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;To re-raise an exception you do not specify an exception instance. You only do that when raising a brand new exception. By referencing the “caught” exception instance “e” in the raise statement, the runtime will naively handle that exception (destroying the exception instance) and then goes right ahead and raises that destroyed - dead - instance.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The exception instance gets handled AND re-raised and when the already handled (destroyed) exception arrives at another exception handler, all hell breaks loose.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;It strikes me that the compiler/RTL between them should be able to tell when you do this and treat “raise e” as simply “raise” when “e” is a reference to the currently-being handled exception.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;But for now, it’s something to be wary of.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Footnote&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;There’s an entirely clean triple-entendre in this post’s title.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;1. The technical aspect covered above - raising a handled (dead) exception&lt;/p&gt;&lt;br /&gt;&lt;p&gt;2. Stress related health concerns that have been bothering me for the past 12 months or so and which came to a head at the end of last year, are hopefully if not behind me then at least waving as I sail them by on the freeway.  I did not actually die - quite obviously - but believed I was close to it on more than one occasion.  and which caused me to take a break from engaging in the Delphi community including this blog.  My activity may not be as high as it once was, at least for a while, but I am re-raised at last.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;3. It is no exaggeration to say that a factor, albeit a small one, in my recovery has been the undoubted resurgence in the vitality of Delph itself.  A raising from the dead (again? some might say) of Delphi.&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-1067167746746567441?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/1067167746746567441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=1067167746746567441' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/1067167746746567441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/1067167746746567441'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/raising-dead.html' title='Raising The Dead'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-2689104637779406806</id><published>2009-04-25T19:46:00.000-07:00</published><updated>2009-04-25T19:57:09.672-07:00</updated><title type='text'>Delphi Prism and DataSnap Server Method Stream Parameters</title><content type='html'>&lt;h4&gt;Stream Parameter Types&lt;br /&gt;&lt;/h4&gt;&lt;p&gt;This table shows the parameter types and return types in the stream samples. The columns under “Server Parameter” describe the parameter or return type in the Delphi DataSnap servers methods. The “Delphi Type” column shows the corresponding type used in the Delphi client. The “Delphi Prism Type” column shows type used in the Delphi Prism client.&lt;/p&gt;&lt;br /&gt;&lt;h4&gt;Code Samples&lt;br /&gt;&lt;/h4&gt;&lt;p&gt;The following code samples show the differences between calling server methods with DbExpress in Delphi compared to ADO.NET in Delphi Prism.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_e42QR63MTVU/SfPNYdimTfI/AAAAAAAAADU/dYDjnYrX3QM/s1600-h/streamsclient_1203.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5328828604239728114" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 229px" alt="" src="http://1.bp.blogspot.com/_e42QR63MTVU/SfPNYdimTfI/AAAAAAAAADU/dYDjnYrX3QM/s400/streamsclient_1203.jpg" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-2689104637779406806?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/2689104637779406806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=2689104637779406806' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2689104637779406806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2689104637779406806'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/delphi-prism-and-datasnap-server-method.html' title='Delphi Prism and DataSnap Server Method Stream Parameters'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_e42QR63MTVU/SfPNYdimTfI/AAAAAAAAADU/dYDjnYrX3QM/s72-c/streamsclient_1203.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-4777247749137585237</id><published>2009-04-25T19:45:00.000-07:00</published><updated>2009-04-25T19:46:00.562-07:00</updated><title type='text'>key-feature of NativeDB</title><content type='html'>&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Direct database access&lt;/b&gt;&lt;/span&gt; is the single most important&lt;br /&gt;key-feature of NativeDB. NativeDB skips both the Borland Database Engine (BDE),&lt;br /&gt;the Microsoft's Open Database Connectivity (ODBC) and OLEDB layers. Thus make it&lt;br /&gt;easy to deploy, install and configure your end-user application. Instead it connects&lt;br /&gt;directly to the database layer provided by the database manufacturer. The result is&lt;br /&gt;high performance data-access, with less code overhead compared to any other standard&lt;br /&gt;database interface available today. NativeDB is a set of components that can work&lt;br /&gt;or link directly with your application executable. You don't have to worry about&lt;br /&gt;BDE, ODBC, MDAC or OLEDB distribution, configuration and version conflict issues&lt;br /&gt;anymore. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-4777247749137585237?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/4777247749137585237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=4777247749137585237' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4777247749137585237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4777247749137585237'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/key-feature-of-nativedb.html' title='key-feature of NativeDB'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-3838883398763313956</id><published>2009-04-25T19:42:00.000-07:00</published><updated>2009-04-25T19:43:29.666-07:00</updated><title type='text'>How can XLSReadWriteII help you</title><content type='html'>&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Native access to Excel files. The user&lt;br /&gt;doesn't need to have Excel, or any other software installed.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;XLSReadWriteII works as an invisible Excel&lt;br /&gt;workbook. All cell values are always accessible.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Stability. One of the major goals with&lt;br /&gt;XLSReadWriteII was to create a product that won't corrupt the Excel files&lt;br /&gt;and won't alter any data in the file.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;XLSReadWriteII is easy to use. With the&lt;br /&gt;&lt;br /&gt;formatting interface,  you can format cells through a&lt;br /&gt;cell object.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Fast and efficient support when you have&lt;br /&gt;any questions.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;No runtime fees for the component.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Full source code included.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;We released the first version of&lt;br /&gt;XLSReadWrite in 1998. At that time it was the only component that could&lt;br /&gt;read and write Excel 97+ files. We are commited to have the leading Excel&lt;br /&gt;solution for Delphi in the future as well. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-3838883398763313956?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/3838883398763313956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=3838883398763313956' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/3838883398763313956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/3838883398763313956'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/how-can-xlsreadwriteii-help-you.html' title='How can XLSReadWriteII help you'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-7113582211030595832</id><published>2009-04-24T19:08:00.000-07:00</published><updated>2009-04-24T19:12:24.340-07:00</updated><title type='text'>How to Hook the Mouse to Catch Events Outside of Delphi application</title><content type='html'>&lt;div id="articlebody"&gt;&lt;p&gt;Learn how to track the mouse activity even when your application is not active, sits in the Tray or does not have any UI at all.&lt;br /&gt;&lt;p&gt;By installing a system wide (or global) mouse hook you can monitor what the user is doing with the mouse and act accordingly.&lt;br /&gt;&lt;h3&gt;Windows Hooks?&lt;/h3&gt;In short, a hook is a (callback) function you can create as part of a DLL (dynamic link library) or your application to monitor the 'goings on' inside the Windows operating system.&lt;br /&gt;There are 2 types of hooks - global and local. A local hook monitors things happening only for a specific program (or thread). A global hook monitors the entire system (all threads).&lt;br /&gt;&lt;p&gt;The article "An introduction to hook procedures", states that to create a global hook you need 2 projects, 1 to make the executable file and 1 to make a DLL containing the hook procedure.&lt;br /&gt;Working with keyboard hooks from Delphi explains how to intercept the keyboard input for controls that cannot receive the input focus (like TImage).&lt;br /&gt;&lt;h3&gt;Let's Hook the Mouse ...&lt;/h3&gt;By design, the movement of the mouse is restricted by the size of your desktop screen (including the Windows Task Bar). When you move the mouse to the left/right/top/bottom edge, the mouse will "stop" - as expected (if you do not have more that one monitor).&lt;br /&gt;&lt;p&gt;Here's an idea for the system-wide mouse hook ....&lt;br /&gt;&lt;p&gt;If, for example, you want to move the mouse to the right side of the screen when it moves toward the left edge (and "touches" it), you might write a global mouse hook to reposition the mouse pointer.&lt;br /&gt;&lt;p&gt;You start by creating a dynamic link library project. The DLL should export two methods : "HookMouse" and "UnHookMouse".&lt;br /&gt;&lt;p&gt;The HookMouse procedure calls the &lt;i&gt;SetWindowsHookEx&lt;/i&gt; API passing the "WH_MOUSE" for the first parameter - thus installing a hook procedure that monitors mouse messages. One of the parameters to the SetWindowsHookEx is your callback function Windows will call when there is a mouse message to be processed:&lt;br /&gt;&lt;p&gt;SetWindowsHookEx(WH_MOUSE, @HookProc, HInstance,0) ;&lt;br /&gt;&lt;p&gt;The last parameter (value = 0) in the SetWindowsHookEx defines we are registering a global hook.&lt;br /&gt;&lt;p&gt;The HookProc parses the mouse related messages and sends a custom message ("MouseHookMessage") to our test project:&lt;br /&gt;&lt;blockquote class="yes"&gt;&lt;b&gt;function&lt;/b&gt; HookProc(nCode: Integer; MsgID: WParam; Data: LParam): LResult; stdcall;&lt;br /&gt;&lt;b&gt;var&lt;/b&gt;&lt;br /&gt;   mousePoint: TPoint;&lt;br /&gt;   notifyTestForm : boolean;&lt;br /&gt;   MouseDirection : TMouseDirection;&lt;br /&gt;&lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;   mousePoint := PMouseHookStruct(Data)^.pt;&lt;br /&gt;&lt;br /&gt;   notifyTestForm := false;&lt;br /&gt;&lt;br /&gt;   &lt;b&gt;if&lt;/b&gt; (mousePoint.X = 0) &lt;b&gt;then&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;     Windows.SetCursorPos(-2 + Screen.Width, mousePoint.y) ;&lt;br /&gt;     notifyTestForm := true;&lt;br /&gt;     MouseDirection := mdRight;&lt;br /&gt;   &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;br /&gt;....&lt;br /&gt;&lt;br /&gt;   &lt;b&gt;if&lt;/b&gt; notifyTestForm &lt;b&gt;then&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;     PostMessage(FindWindow('TMainHookTestForm', nil), MouseHookMessage, MsgID, Integer(MouseDirection)) ;&lt;br /&gt;   &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;br /&gt;   Result := CallNextHookEx(Hook,nCode,MsgID,Data) ;&lt;br /&gt;&lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;Note 1: Read the Win32 SDK Help files to find out about the PMouseHookStruct record and the signature of the HookProc function.&lt;br /&gt;&lt;p&gt;Note 2: a hook function does not need to send anything anywhere - the PostMessage call is used only to indicate that the DLL can comunicate with the "outer" world.&lt;br /&gt;&lt;h3&gt;Mouse Hook "Listener"&lt;/h3&gt;The "MouseHookMessage" message is posted to our test project - a form named "TMainHookTestForm". We override the WndProc method to get the message and act as needed:&lt;br /&gt;&lt;blockquote class="yes"&gt;&lt;b&gt;procedure&lt;/b&gt; TMainHookTestForm.WndProc(&lt;b&gt;var&lt;/b&gt; Message: TMessage) ;&lt;br /&gt;&lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;inherited&lt;/b&gt; WndProc(Message) ;&lt;br /&gt;&lt;br /&gt;   &lt;b&gt;if&lt;/b&gt; Message.Msg = HookCommon.MouseHookMessage &lt;b&gt;then&lt;/b&gt;&lt;br /&gt;   &lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;     &lt;i&gt;//implementation found in the accompanying code&lt;/i&gt;&lt;br /&gt;     Signal(TMouseDirection(Message.LParam)) ;&lt;br /&gt;   &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;Of course, when the form is created (OnCreate) we call the HookMouse procedure from the DLL, when it gets closed (OnDestroy) we call the UnHookMouse procedure.&lt;br /&gt;&lt;p&gt;Download both projects to test and further explore the code.&lt;br /&gt;&lt;p&gt;Note: hooks tend to slow down the system because they increase the amount of processing the system must perform for each message. You should install a hook only when necessary, and remove it as soon as possible. &lt;!--/gc--&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-7113582211030595832?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/7113582211030595832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=7113582211030595832' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/7113582211030595832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/7113582211030595832'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/how-to-hook-mouse-to-catch-events.html' title='How to Hook the Mouse to Catch Events Outside of Delphi application'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-2767960543857595964</id><published>2009-04-24T18:55:00.000-07:00</published><updated>2009-04-24T18:56:17.561-07:00</updated><title type='text'>Castalia for Delphi</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_e42QR63MTVU/SfJtutc0QhI/AAAAAAAAADM/NvaKm8nVUfA/s1600-h/castalia_splash.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5328441958374588946" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 223px" alt="" src="http://3.bp.blogspot.com/_e42QR63MTVU/SfJtutc0QhI/AAAAAAAAADM/NvaKm8nVUfA/s400/castalia_splash.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Great developers need great tools&lt;br /&gt;Castalia transforms the Delphi programming environment into an amazing development platform. Castalia lives on the bleeding edge of IDE technology, giving you cutting edge tools to write better code faster, understand code more accurately, and improve code you've already written. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-2767960543857595964?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/2767960543857595964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=2767960543857595964' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2767960543857595964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2767960543857595964'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/castalia-for-delphi.html' title='Castalia for Delphi'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_e42QR63MTVU/SfJtutc0QhI/AAAAAAAAADM/NvaKm8nVUfA/s72-c/castalia_splash.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-4631108970422060857</id><published>2009-04-23T19:20:00.000-07:00</published><updated>2009-04-23T19:21:10.485-07:00</updated><title type='text'>How to Unit Test a Data Module</title><content type='html'>&lt;div class="entry-content"&gt;&lt;p&gt;Data modules are unit tested in exactly the same way that you would unit test any other piece of code. That is, by refactoring the code to be tested in such a way as to separate it from code not relevant to the test. But &lt;a title="DUnit Testing in a Midas/DataSnap project" href="http://stackoverflow.com/questions/247978/dunit-testing-in-a-midas-datasnap-project"&gt;since people occasionally seem to find this confusing&lt;/a&gt;, perhaps a practical example is in order.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Imagine that you have been given the task of fixing a bug in the following code. Before you fix the bug, you would like to write a unit test which shows the bug, in order to prevent regressions after you fix it.&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;strong&gt;procedure &lt;/strong&gt;TMyDM.qryFooCalcFields(DataSet: TDataSet);&lt;br /&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;br /&gt;  Minimum, PieceRate: Double;&lt;br /&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;br /&gt;  Minimum := qryFooHOURS.Value / qryFooMINIMUM_WAGE.Value; &lt;em&gt;// &lt;/em&gt;&lt;/code&gt;&lt;em&gt;&lt;code&gt;oops; should be *&lt;/code&gt;&lt;/em&gt;&lt;code&gt;&lt;br /&gt;  PieceRate := qryFooPIECE_RATE.Value * qryFooPIECES.Value;&lt;br /&gt;  qryFooEarnings.Value := Max(Minimum, PieceRate);&lt;br /&gt;&lt;strong&gt;end&lt;/strong&gt;;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;Now, tests which access a database are, generally speaking, integration tests rather than unit tests. But the code you’ve been asked to fix seems to be pretty wound up in database access. It doesn’t have to be, though. Let’s refactor:&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;strong&gt;function &lt;/strong&gt;TMyDM.CalcEarnings(AHours, AMinimumWage, APieceRate, APieces: Double): double;&lt;br /&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;br /&gt;  Minimum, PieceRate: Double;&lt;br /&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;br /&gt;  Minimum := AHours / AMinimumWage; &lt;em&gt;// oops; should be *&lt;/em&gt;&lt;br /&gt;  PieceRate := APieceRate * APieces;&lt;br /&gt;  Result := Max(Minimum, PieceRate);&lt;br /&gt;&lt;strong&gt;end&lt;/strong&gt;;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;procedure &lt;/strong&gt;TMyDM.qryFooCalcFields(DataSet: TDataSet);&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;br /&gt;  qryFooEarnings.Value := CalcEarnings(qryFooHOURS.Value,&lt;br /&gt;    qryFooMINIMUM_WAGE.Value, qryFooPIECE_RATE.Value, qryFooPIECES.Value);&lt;br /&gt;&lt;strong&gt;end&lt;/strong&gt;;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;Resist any temptation to actually fix the bug at the moment; we went to write a unit test which fails before making it pass by fixing the bug. Note that you can make CalcEarnings static, meaning you won’t even need an instance of the data module in order to unit test the function:&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;strong&gt;procedure &lt;/strong&gt;TestMyDM.CalcEarnings;&lt;br /&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;br /&gt;  Actual, Delta, Expected, Hours, Minimum, PieceRate, Pieces: Double;&lt;br /&gt;&lt;strong&gt;begin&lt;/strong&gt;&lt;br /&gt;  Hours := 1;&lt;br /&gt;  Minimum := 7;&lt;br /&gt;  PieceRate := 1;&lt;br /&gt;  Pieces := 1;&lt;br /&gt;  Expected := 7;&lt;br /&gt;&lt;br /&gt;  Actual := TMyDM.CalcEarnings(Hours, MinimumWage, PieceRate, Pieces);&lt;br /&gt;&lt;br /&gt;  Delta := 0.0001;&lt;br /&gt;  CheckEquals(Expected, Actual, Delta);&lt;br /&gt;&lt;strong&gt;end&lt;/strong&gt;;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;There are aspects of this code which will be hard to unit test. I could, for example, pass the wrong field value into the refactored function. I can fix that by abstracting the data access layer, but it’s not a complete fix, since I might have the wrong data in the database. The fact is that unit testing can only catch so much, and integration testing will always be necessary, as well. The important point is that I have isolated the bug which I was asked to fix, and future regressions in &lt;em&gt;that code&lt;/em&gt; will now be caught.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I wonder if some Delphi users are confused by the term "unit test." The word "unit" means something very different in Delphi than it does in the term "unit test." In "unit testing," the word "unit" refers to a single piece of functionality. In Delphi, a unit (reserved word) is a source code file. When you write unit tests, you do not have to test an entire unit at a time. Unit tests are for specific cases of using a specific function.&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-4631108970422060857?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/4631108970422060857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=4631108970422060857' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4631108970422060857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4631108970422060857'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/how-to-unit-test-data-module_23.html' title='How to Unit Test a Data Module'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-3486355286896560580</id><published>2009-04-23T19:16:00.000-07:00</published><updated>2009-04-23T19:17:08.356-07:00</updated><title type='text'>New Delphi Product Manager and R&amp;D Manager</title><content type='html'>You probably have already heard, but people inside CodeGear have shifted their roles, including the Delphi Product Manager.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Nick Hodges&lt;/strong&gt;, who was Delphi Product Manager is now Delphi R&amp;amp;D Manager. So rather than promoting the product to the community he's more in charge of shaping the future of the product. Having known Nick for many years, I think this is going to be interesting. You can read more on his blog post A New Role for Nick. Let me thank him for his work at Product Manager, that started in a period of turmoil but ended with the product back in a good shape, and wish him best luck for this new assignment. And if you need ideas about Delphi future, I'm ready to provide a few...&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Mike Rozlog&lt;/strong&gt;, who was JBuilder Product Manager, is now Delphi Product Manager (see his Changes in the Wind Part II). It won't be easy to get out of Nick's shadow, but Mike has a long-term relationship with Delphi as a product, and even if he's not such a prominent figure in the community right now, he can certainly gain that status and help the product go forward. He looks to have more of a "database/business" oriented perspective, and this can be very important to push Delphi it one of its fundamental roles (that of a client/server tool for business applications) that at times has been a bit neglected.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Chris Pattinson&lt;/strong&gt;, who was heading the Quality Assurance team for RAD Studio (after some big troubles with quality in previous versions), has been appointed as Director of Quality Assurance for Embarcadero as a whole, supervising the development of both CodeGear and DatabaseGear products. Kudos to Chris for this key assignment, I'm sure he'll do well as he helped Delphi become a solid tool once more.&lt;br /&gt;&lt;br /&gt;Well, let me thank the three of them for what they have done in the past at CodeGear and wish them all the best in their future CodeGear/Embarcadero roles. I hope to have time to chat to at least Nick and Mike at Delphi Live.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-3486355286896560580?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/3486355286896560580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=3486355286896560580' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/3486355286896560580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/3486355286896560580'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/new-delphi-product-manager-and-r.html' title='New Delphi Product Manager and R&amp;D Manager'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-5417661803615188526</id><published>2009-04-23T19:10:00.000-07:00</published><updated>2009-04-23T19:14:15.179-07:00</updated><title type='text'>How to Right Align a Menu Item</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_e42QR63MTVU/SfEgcON3NuI/AAAAAAAAADE/JwIQV7eNUBw/s1600-h/menuitemright.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5328075503380674274" style="FLOAT: right; MARGIN: 0px 0px 10px 10px; WIDTH: 150px; CURSOR: hand; HEIGHT: 108px" alt="" src="http://3.bp.blogspot.com/_e42QR63MTVU/SfEgcON3NuI/AAAAAAAAADE/JwIQV7eNUBw/s320/menuitemright.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;In most applications all (top level) menu items are aligned at the =&lt;br /&gt;left side=20&lt;br /&gt;of the menu bar. I'm sure you have seen applications with at least one =&lt;br /&gt;item=20&lt;br /&gt;aligned on the right side. In most cases this was the "Help" menu item.=20&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Here's how to align a form's Help menu item (for example) on the =&lt;br /&gt;right side=20&lt;br /&gt;of the menu bar, in Delphi applications.=20&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Add a TMainMenu component to a form (Form1)=20&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Add several (top level) menu items (with sub items)=20&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Have a menu item named "HelpMenuItem"=20&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Use the code below in the form's OnCreate event.=20&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Run the project ... note that the "Help" item is aligned on the =&lt;br /&gt;right side=20&lt;br /&gt;of the menu bar. &lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote class="3Dyes"&gt;&lt;b&gt;procedure&lt;/b&gt; TForm1.FormCreate(Sender: =&lt;br /&gt;TObject)=20&lt;br /&gt;;&lt;br /&gt;&lt;b&gt;var&lt;/b&gt;&lt;br /&gt;mii: TMenuItemInfo;&lt;br /&gt;=&lt;br /&gt;MainMenu:=20&lt;br /&gt;hMenu;&lt;br /&gt;Buffer: &lt;b&gt;array&lt;/b&gt;[0..79] &lt;b&gt;of=20&lt;br /&gt;Char&lt;/b&gt;;&lt;br /&gt;&lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;MainMenu :=3D=20&lt;br /&gt;Self.Menu.Handle;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;//GET Help Menu Item=20&lt;br /&gt;Info&lt;/i&gt;&lt;br /&gt;mii.cbSize :=3D SizeOf(mii) ;&lt;br /&gt;=&lt;br /&gt;mii.fMask=20&lt;br /&gt;:=3D MIIM_TYPE;&lt;br /&gt;mii.dwTypeData :=3D =&lt;br /&gt;Buffer;&lt;br /&gt;=20&lt;br /&gt;mii.cch :=3D SizeOf(Buffer) ;&lt;br /&gt;=&lt;br /&gt;GetMenuItemInfo(MainMenu,=20&lt;br /&gt;HelpMenuItem.Command, false, mii) ;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;//SET Help =&lt;br /&gt;Menu=20&lt;br /&gt;Item Info&lt;/i&gt;&lt;br /&gt;mii.fType :=3D mii.fType or=20&lt;br /&gt;MFT_RIGHTJUSTIFY;&lt;br /&gt;SetMenuItemInfo(MainMenu,=20&lt;br /&gt;HelpMenuItem.Command, false, mii) ;&lt;br /&gt;&lt;b&gt;end&lt;/b&gt;; &lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-5417661803615188526?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/5417661803615188526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=5417661803615188526' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/5417661803615188526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/5417661803615188526'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/how-to-right-align-menu-item.html' title='How to Right Align a Menu Item'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_e42QR63MTVU/SfEgcON3NuI/AAAAAAAAADE/JwIQV7eNUBw/s72-c/menuitemright.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-4499015904163050364</id><published>2009-04-23T02:28:00.001-07:00</published><updated>2009-04-23T02:32:35.821-07:00</updated><title type='text'>Optimal project settings</title><content type='html'>&lt;strong&gt;What will we talk about?&lt;/strong&gt;&lt;br /&gt;Ok, let’s see, what options do I mean: open your project’s options and take a look at “Compiling” and “Linking” pages (those pages are called “Compiler” and “Linker” in old Delphi versions):&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_e42QR63MTVU/SfA05x86yRI/AAAAAAAAAC0/VY-Wt5TLRlQ/s1600-h/compiling_thumbnail.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5327816526445332754" style="WIDTH: 300px; CURSOR: hand; HEIGHT: 296px" alt="" src="http://4.bp.blogspot.com/_e42QR63MTVU/SfA05x86yRI/AAAAAAAAAC0/VY-Wt5TLRlQ/s320/compiling_thumbnail.png" border="0" /&gt;&lt;/a&gt; “Compiling” page in project’s options (D2009)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_e42QR63MTVU/SfA1FZSaZAI/AAAAAAAAAC8/UY1WTQk16vE/s1600-h/linking_thumbnail.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5327816725983028226" style="WIDTH: 300px; CURSOR: hand; HEIGHT: 180px" alt="" src="http://2.bp.blogspot.com/_e42QR63MTVU/SfA1FZSaZAI/AAAAAAAAAC8/UY1WTQk16vE/s320/linking_thumbnail.png" border="0" /&gt;&lt;/a&gt;“Linking” page in project’s options (D2009)&lt;br /&gt;&lt;br /&gt;&lt;p&gt;On “Compiler” page we are interested in “Stack Frames”, group of “Debug information”, “Local Symbols” and “Symbol reference info”, “I/O Checking”, “Overflow checking” and “Range checking”. On “Linking” page - “Map file”, “Debug Information” (this option is known as “Include TD32 debug info” in previous Delphi versions) and “Include remote debug symbols”.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Let’s see what these options do. And then - what are the best settings for them and why. We will have in mind the scenario of usual application and EurekaLog-enabled application.&lt;br /&gt;&lt;br /&gt;Besides, the project settings can differs for debug and release targets - i.e.: do you compile application for your self (for debugging) or for end-user deployment. There are settings profiles (Debug and Release) in new Delphi versions. You can specify individual settings for each profile and just toggle between them before compilation. Older Delphi version have only one global profile, so you have to change every single option manually.&lt;br /&gt;&lt;br /&gt;Please, remember, that you need to make a full build (and not just compile), if you’ve changed one of those options.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;What do these options mean?&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;The most important settings are set of options “Debug information” (”Compiling” page), “Local Symbols” and “Symbol reference info”.&lt;br /&gt;&lt;br /&gt;The program is set of machine’s (CPU) instructions - which are just numbers. The source code is a text file. The question: how does the debugger know, when he needs to stop, when you are setting a breakpoint in your source? Where is correspondence between raw numbers and human-readable text?&lt;br /&gt;&lt;br /&gt;This correspondence is a &lt;strong&gt;debug information&lt;/strong&gt;. Roughly speaking, the debug information is set of instructions like: “the machine codes no. 1056-1059 correspond to line 234 of Unit1″. The debugger works thanks to such debug info.&lt;br /&gt;&lt;br /&gt;And these options? They controls the generation of debug information for your units.&lt;br /&gt;&lt;br /&gt;The debug information is stored in dcu-files together with its compiled code. I.e. the very same Unit1.pas can be compiled into different dcu-files (with or without debug information). The debug information increases compilation time, size of dcu-files, but it does not affect size or speed of resulting application (i.e. &lt;strong&gt;debug information is not included into application&lt;/strong&gt;).&lt;br /&gt;&lt;br /&gt;There are cases, when you want to have debug information in your files or (at least) near them. For example: if you are going to do remote debugging or debugging of external process. OR if you want to have human-readable call-stack in your exception diagnostic tool (EurekaLog).&lt;br /&gt;&lt;br /&gt;You can embed debug information into your files by two ways: either you play with project’s options (using “Map File”, “Debug information” (Linker)/”Include TD32 Debug info” or “Include remote debug symbols” options) OR you use some sort of expert (for example, EurekaLog or JCL), which injects debug information in his own format into your executables.&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;“Debug information” – that is the debug info itself. You should enable this option if you want to do step-by-step debugging or have call stacks with names. EurekaLog enables this option automatically for you. But if you mess with your project’s settings…&lt;/li&gt;&lt;br /&gt;&lt;li&gt;“Local symbols” – it is “addon” for usual debug information. This is correspondence between program’s data and variables names in source code. You need to enable this option if you want to see and change variables. Also, call stack window in Delphi can display function’s arguments with this option.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;“Reference info” – this is additional information for code editor, which allows him to display detailed information about identificators. For example: where were a variable declared.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;Those options are very cose related and usually there is no need to enable or disable only one of them - they are switched together.&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;“Use Debug DCUs” - this very important option switches compilation between using debug and release versions of standard Delphi’s units. If you were attentive, then you could notice that real pas-files in Source folder are never used during compilation. Instead, the precompiled files (in dcu) are used. They are taken from Lib or Lib\Debug folders. This trick greatly decreases compilation time. Because dcu can be compiled with and without debug information - there are two sets of dcus in Lib folder. By toggling this option you’ll specify which one Delphi should use for you. If you switch this option off - then you won’t be able to debug standard Delphi code or see detailed call stack for it.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;“Stack Frames” - this option controls &lt;a title="'See" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Call_stack?referer=http://www.delphiplus.org/news.html');" href="http://en.wikipedia.org/wiki/Call_stack" target="_blank"&gt;stack frames&lt;/a&gt; generation. If the option is off then stack frames won’t be generated unless they are needed. If the option is on - then stack frames will be generated always. Stack frames are used for frame-based stack-tracing method (the raw-tracing method do not require stack frames). I.e. it is used for building call stack. In usual application stack frames are generated almost everywhere.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;“Range checking” - this is a very useful helper for debugging problems with array-based structures. With it, compiler will insert additional checks (for strings, arrays, etc), which checks the correctness of indexes. If you (by mistake) pass an invalid index - the exception of type ERangeError will be generated. And you can find your error. If the option is off then there is no additional code. Enabling this option slightly increases size of your application and slows down it execution. It is recommended to turn this option for debugging only.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;“Overflow checking” - it is somehow similar to “Range checking”, except checking code checks overflows in arithmetic operations. If result of operation is not suitable for storage variable - then exception EIntOverflow will be raised. For example: we have a byte variable, which holds 255 now. And we add 2 to it. There should be 257, but it can not be stored in byte variable, so real result will be 1. That is integer overflow. This option is actually rarely used. There are three reasons for it: different code often depends on it to be turned off. That means that enabling this option will break such code. Secondly: usually you work with Integer, and your logic rarely involves dealing with values on Integer’s range border. And third: arithmetic operations is very common code, so adding additional checks to every operation can slow down your code significantly.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;“I/O Checking” - this option is used for working with “files in Pascal-style” (AssignFile, Reset, etc), This feature is deprecated and you shouldn’t use these routines and therefore you don’t need to touch this option.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;“Map file” - by enabling this option you tell the Delphi’s linker to create a separate map-file along with your executable. Map file contains human-readable representation of debug information. Different settings for this option controls the detalization level of output. Usually, there is no need to change it to anything, which differs from “Off” or “Detailed”. The map-file is used by various tools as primary source of debug information. For example, EurekaLog automatically turns this option on and uses map-file to create a debug information in its own format and then injects it into application. That is why you rarely need to change this option manually.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;“Debug Information” (Linker)/”Include TD32 debug info” - this option embeds debug information for external debugger in TD32 format into your application. You may need this option if you use “Run”/”Attach to process” and Delphi can not find debug information. Note, that size of your application can increase 5-10 times by enabling this option. So, it is not good choice for storing debug info in release version - it is better to use EurekaLog (or any other source of debug information, which is supported by EL; for example - JCL).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;“Include remote debug symbols” - very similar to previous option, but this creates a rsm-file with debug information for Delphi remote debugger. You need this option, if you want to do remote debugging.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;Note, that these options can be enabled not only globally, but also separately for each unit (several options can affect single routines or, even, lines of code). This is done by using usual compiler directives (you can see them in help - by pressing F1 while you stay in project’s options dialog). For example, “Stack Frames” is controlled by {$W+} and {$W-}.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So, by summarizing all this info, we can give a recommendations for different cases. They are written down below. Settings, which differs from defaults are marked in &lt;strong&gt;bold&lt;/strong&gt; (i.e. you should toggle them manually).&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Usual application, without EurekaLog&lt;/h2&gt;&lt;br /&gt;&lt;h3&gt;Base settings for each profile&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;All debug options (”Debug information” (Compiler), “Local symbols”, “Reference info”) does not affect the resulting application and do not disturb us - so you usually should keep them always on.&lt;br /&gt;&lt;br /&gt;“Use Debug DCUs” - set it as you like (depending on: “do you want to debug standard Delphi code or not?”).&lt;br /&gt;&lt;br /&gt;There is no need to turn on “Stack Frames” option.&lt;br /&gt;&lt;br /&gt;There is no need for map-files.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Debug profile&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Turn on&lt;/strong&gt; “Range checking” and (optionally) “Overflow checking”.&lt;br /&gt;&lt;br /&gt;“Include TD32 debug info” - enable it only if you use “Attach to process” while debugging.&lt;br /&gt;&lt;br /&gt;“Include remote debug info” - enable it only if you want to use remote debugger.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Release profile&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Turn off “Range checking”, “Overflow checking”, “Include TD32 debug info” and “Include remote debug info”.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;EurekaLog-enabled application&lt;/h2&gt;&lt;br /&gt;&lt;h3&gt;Base settings for each profile&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;All debug options (”Debug information” (Compiler), “Local symbols”, “Reference info”) should be definitely turned on. Otherwise, call stack functionality won’t be working.&lt;br /&gt;&lt;br /&gt;There is no need to turn &lt;strong&gt;OFF&lt;/strong&gt; “Stack Frames” option.&lt;br /&gt;&lt;br /&gt;Generation of map-file should be turned on, but EurekaLog’s expert takes cares of it.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Debug profile&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;“Use Debug DCUs” - set it as you like.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Turn on&lt;/strong&gt; “Range checking” and (optionally) “Overflow checking”.&lt;br /&gt;&lt;br /&gt;“Include TD32 debug info” - enable it only if you use “Attach to process” while debugging.&lt;br /&gt;&lt;br /&gt;“Include remote debug info” - enable it only if you want to use remote debugger.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Release profile&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Turn on&lt;/strong&gt; “Use Debug DCUs” option.&lt;br /&gt;&lt;br /&gt;Turn off “Range checking”, “Overflow checking”, “Include TD32 debug info” and “Include remote debug info”.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;What can go wrong if I mess up with my settings?&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Well, that means, for example, impossibility of debugging (say, missed information for remote debugger of turned off “Debug information” (Compiler) option), large size of application (for example - you forgot to turn off “Debug information” (Linker)/”Include TD32 debug info”), slow execution (for example: application was compiled with debug code), missed or partial call stacks in EurekaLog (for example, you managed to turn off “Debug information” (Compiler) or you do not use “Use Debug DCUs”). In rare cases there can be work/not-work difference (for example, swithing on “Stack frames” can slightly decrease maximum depth of recursive algorithm). There are few other minor issues.&lt;br /&gt;&lt;br /&gt;BTW, if you develop a component - do not forget that Delphi have two sets of dcus. Generally, toggling debug options does not affect interface and implementation parts of dcus. So, different versions of dcus are compatitible with each other. But it is not always so - code may use conditional defines. That is why it is possible to have binary incompatible versions of dcu-files of the same source code (and here is a r&lt;a onclick="pageTracker._trackPageview('/outgoing/forums.codegear.com/message.jspa?messageID=36244&amp;amp;referer=http://www.delphiplus.org/news.html');" href="https://forums.codegear.com/message.jspa?messageID=36244"&gt;eal-life example with D2009 and InstanceSize method&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;For this reason, you should also create a two sets of dcu-files: first one should be compiled against usual dcu (”Use Debug DCUs” turned off) and the other one - with debug dcu-files (”Use Debug DCUs” turned on). BTW, it is not important, how you’ll set “Debug information” (Compiler) option for your component (of course, it is only from POV of binary compatibility).&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-4499015904163050364?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/4499015904163050364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=4499015904163050364' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4499015904163050364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/4499015904163050364'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/optimal-project-settings.html' title='Optimal project settings'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_e42QR63MTVU/SfA05x86yRI/AAAAAAAAAC0/VY-Wt5TLRlQ/s72-c/compiling_thumbnail.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-2562016383367261476</id><published>2009-04-21T18:37:00.000-07:00</published><updated>2009-04-21T18:39:04.750-07:00</updated><title type='text'>Profiler for Delphi</title><content type='html'>is a tool to measure the runtime of programs written in Delphi Object Pascal. If an application is too slow, ProDelphi gives the necessary information to optimize it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The principle of source code instrumenting , a sophisticated correction algorithm and the unique granularity of 1 CPU cycle guarantee to get correct measurement results . Source code instrumenting guarantees that always every part of an application is measured.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is contrary to sampling profilers which give random measurement results , the exact execution time of a procedure can not be determined (see also profiler types ). To compare the measurement accuracy of ProDelphi with any other profiler, a profiler tester is supplied in the download area.&lt;br /&gt;&lt;br /&gt;Because of the outstanding low measurement overhead even time critical applications can be measured.&lt;br /&gt;I ntegration into the Delphi IDE, a call graph and a handy viewer guarantee a fast optimization process.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-2562016383367261476?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/2562016383367261476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=2562016383367261476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2562016383367261476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/2562016383367261476'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/profiler-for-delphi.html' title='Profiler for Delphi'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-55840166260117748</id><published>2009-04-21T18:31:00.000-07:00</published><updated>2009-04-21T18:36:14.209-07:00</updated><title type='text'>Writing a RemObjects SDK for .NET Server and Mac Client</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_e42QR63MTVU/Se50DYyWiHI/AAAAAAAAACc/oLjb3PbmdvE/s1600-h/VisualStudioFileNewROWinFormsServer.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5327323010767947890" style="FLOAT: right; MARGIN: 0px 0px 10px 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 186px" alt="" src="http://4.bp.blogspot.com/_e42QR63MTVU/Se50DYyWiHI/AAAAAAAAACc/oLjb3PbmdvE/s320/VisualStudioFileNewROWinFormsServer.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;In this article, we will walk through the process of creating a fully working client and server application using RemObjects SDK, with the server written in .NET and the client written for Mac OS X.&lt;br /&gt;&lt;br /&gt;The article assumes you have Visual Studio and the latest RemObjects SDK for .NET installed in a Windows VM or on a separate PC on your network, and the Xcode 3.0 with the latest RemObjects SDK for OS X on your Mac.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The .NET Server&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Start off by going into Visual Studio to create your server application. Choose FileNew Project from the menu and locate the RemObjects SDK node underneath the language of your choice (C#, Delphi Prism or Visual Basic .NET) - for our example, we’ll choose C#, as most people are familiar with that. Don’t worry, you'll be writing literally two lines of code for this, which easily translate into Delphi Prism or VB if necessary).&lt;br /&gt;&lt;br /&gt;For the purposes of this article, choose the Windows Forms Server option, pick a destination folder and name your project “MyROServer”. Click OK to continue.&lt;br /&gt;&lt;br /&gt;Next, you will be presented with the New RemObjects SDK Server wizard. Since we will be creating our client application in Xcode, on the Mac side, you can uncheck the Also create a matching client application checkbox. Beyond that, all the default settings should be good, although in a real-life project you may want to click into Advanced Project Options to configure names for service and library, or choose different communication channels. Once again, click OK to have the project created.&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_e42QR63MTVU/Se50PQxF0YI/AAAAAAAAACk/8KPEXMQuKJk/s1600-h/VisualStudioNewROServerWizard.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5327323214773604738" style="WIDTH: 320px; CURSOR: hand; HEIGHT: 154px" alt="" src="http://3.bp.blogspot.com/_e42QR63MTVU/Se50PQxF0YI/AAAAAAAAACk/8KPEXMQuKJk/s320/VisualStudioNewROServerWizard.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;On the right-hand side of Visual Studio, you now see your project in Solution Explorer. Next to the usual source files in your language of choice (here .cs), you will see a .RODL file which contains the service definitions for your server. Double-click the file (or press the red RemObjects SDK icon in the toolbar above) to edit the RODL.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_e42QR63MTVU/Se50eGjnowI/AAAAAAAAACs/5VSCDwblaQ0/s1600-h/VisualStudioROServerSoluntionExplorer1.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5327323469730784002" style="WIDTH: 288px; CURSOR: hand; HEIGHT: 248px" alt="" src="http://4.bp.blogspot.com/_e42QR63MTVU/Se50eGjnowI/AAAAAAAAACs/5VSCDwblaQ0/s320/VisualStudioROServerSoluntionExplorer1.png" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1881358427466534365-55840166260117748?l=talkdelphi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talkdelphi.blogspot.com/feeds/55840166260117748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1881358427466534365&amp;postID=55840166260117748' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/55840166260117748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1881358427466534365/posts/default/55840166260117748'/><link rel='alternate' type='text/html' href='http://talkdelphi.blogspot.com/2009/04/writing-remobjects-sdk-for-net-server.html' title='Writing a RemObjects SDK for .NET Server and Mac Client'/><author><name>hidelphi</name><uri>http://www.blogger.com/profile/15186454371633228380</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_e42QR63MTVU/Se50DYyWiHI/AAAAAAAAACc/oLjb3PbmdvE/s72-c/VisualStudioFileNewROWinFormsServer.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1881358427466534365.post-90094747165558645</id><published>2009-04-20T18:35:00.000-07:00</published><updated>2009-04-20T18:42:19.278-07:00</updated><title type='text'>Web Service Projects and Sessions</title><content type='html'>Apart from ASP.NET Web Service solutions using the Web Site target, the Feb 2009 update of Delphi Prism introduced Web Projects that also support ASP.NET Web Services. Let's use this new way as basis for the next example that demonstrates the use of the EnableSession attribute.&lt;br /&gt;First of all, do File New, but this time do not select File New - Web Site, but select File New - Project instead. As one of the New Project targets, we can select Web and then pick an ASP.NET Web Application, as can be seen below.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_e42QR63MTVU/Se0jOCKVdlI/AAAAAAAAACE/MgkaseYrYAE/s1600-h/examnb1a.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5326952658254526034" style="WIDTH: 320px; CURSOR: hand; HEIGHT: 221px" alt="" src="http://1.bp.blogspot.com/_e42QR63MTVU/Se0jOCKVdlI/AAAAAAAAACE/MgkaseYrYAE/s320/examnb1a.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Note that we can select the (minimum) version of the .NET Framework for this project (3.5 in the screenshot above), and unlike the Web Site, we cannot select HTTP as location, but need to specify a normal location for the Web Project. When we deploy the project, we can select a HTTP location as we'll see later in this section. For the new example, select MyWebService as Name for the solution as well as the project. Note that this will produce an ASP.NET Web Application, and not directly an ASP.NET Web Service, but this can be "fixed" after the project is created.&lt;br /&gt;After we click on OK, a new ASP.NET Web Application project called MyWebService is created (in a solution which is also called MyWebService). The Solution Explorer shows the project with a Default.aspx web page, as well as a Global.asax (for the ASP.NET application object) and a web.config file. We don't need the Default.aspx and related source files, so open the node in the Solution Explorer, select the three files Default.aspx, Default.aspx.designer.pas as well as Default.aspx.pas, right-click on the nodes and select Remove. In the dialog that follows, you can click on Delete to permanently delete Default.aspx (and the related .pas files).&lt;br /&gt;Without the Default web page, the project is only ASP.NET and needs another main item. Right-click on the MyWebService project node, and select "Add - New Item. In the dialog that follows, we need to go to the Web category and select a Web Service.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_e42QR63MTVU/Se0jfIpZMmI/AAAAAAAAACM/FoAn7DtONHw/s1600-h/examnb1b.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5326952952053183074" style="WIDTH: 320px; CURSOR: hand; HEIGHT: 198px" alt="" src="http://1.bp.blogspot.com/_e42QR63MTVU/Se0jfIpZMmI/AAAAAAAAACM/FoAn7DtONHw/s320/examnb1b.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Change the name of the Web Service from WebService1.asmx to Service.asmx and click on Add.&lt;br /&gt;First, modify the namespace attribute again,&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;  &lt;b&gt;type&lt;/b&gt;&lt;br /&gt;    [WebService(&amp;amp;Namespace := 'http://eBob42.org/',&lt;br /&gt;      Description := 'This web service is a new demo Web Service&amp;lt;br&gt;' +&lt;br /&gt;        'generated by &amp;lt;b&gt;Delphi Prism&amp;lt;/b&gt; for ASP.NET 2.0 or higher')]&lt;br /&gt;    [WebServiceBinding(ConformsTo := WsiProfiles.BasicProfile1_1)]&lt;br /&gt;    [System.ComponentModel.ToolboxItem(false)]&lt;br /&gt;    // To allow this Web Service to be called from script, using ASP.NET&lt;br /&gt;    // AJAX, uncomment the following line.&lt;br /&gt;    // [System.Web.Script.Services.ScriptService]&lt;br /&gt;    Service = &lt;b&gt;public class&lt;/b&gt;(System.Web.Services.WebService)&lt;br /&gt;    &lt;b&gt;public&lt;/b&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Note the new comment about the System.Web.Script.Services.ScriptService, to allow the web service to be called from JavaScript, a topic for a future article.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:Comic Sans MS;font-size:130%;"&gt;&lt;b&gt;EnableSession&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then, we should remove the demo method HelloWorld, and add four new WebMethods.&lt;br /&gt;All of them with the EnableSession attribute set to true, to enable the use of the ASP.NET session object for these four web methods:&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;    Service = &lt;b&gt;public class&lt;/b&gt;(System.Web.Services.WebService)&lt;br /&gt;    &lt;b&gt;public&lt;/b&gt;&lt;br /&gt;      [WebMethod(EnableSession := true)]&lt;br /&gt;      &lt;b&gt;method&lt;/b&gt; Remember(&lt;b&gt;const&lt;/b&gt; Name,Value: String);&lt;br /&gt;      [WebMethod(EnableSession := true)]&lt;br /&gt;      &lt;b&gt;method&lt;/b&gt; Recall(&lt;b&gt;const&lt;/b&gt; Name: String): String;&lt;br /&gt;      [WebMethod(EnableSession := true)]&lt;br /&gt;      &lt;b&gt;method&lt;/b&gt; Forget(&lt;b&gt;const&lt;/b&gt; Name: String);&lt;br /&gt;      [WebMethod(EnableSession := true)]&lt;br /&gt;      &lt;b&gt;method&lt;/b&gt; Amnesia; // forget all&lt;br /&gt;    &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Press Ctrl+Shift+C to generate the skeletons for the four web methods, and implement them as follows:&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;br /&gt;  &lt;b&gt;method&lt;/b&gt; Service.Remember(&lt;b&gt;const&lt;/b&gt; Name,Value: String);&lt;br /&gt;  &lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;    Session[Name] := Value&lt;br /&gt;  &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;br /&gt;  &lt;b&gt;method&lt;/b&gt; Service.Recall(&lt;b&gt;const&lt;/b&gt; Name: String): String;&lt;br /&gt;  &lt;b&gt;begin&lt;br /&gt;    if&lt;/b&gt; Assigned(Session[Name]) &lt;b&gt;then&lt;/b&gt;&lt;br /&gt;      Result := Session[Name].ToString&lt;br /&gt;    &lt;b&gt;else&lt;/b&gt; Result := ''&lt;br /&gt;  &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;br /&gt;  &lt;b&gt;method&lt;/b&gt; Service.Forget(&lt;b&gt;const&lt;/b&gt; Name: String);&lt;br /&gt;  &lt;b&gt;be
