Create Class By Name

I have build a framework of application that help me to boost the production time, there are a lot of things that i need to make it as flexible as possible and the goal is to have a minimum of coding time and more on design time with drag and drop only, that goal is still long way to go. One of them is a way to create an instance of a class at runtime of course. So I’ve been searching the internet to find a way to do it with minimum effort on the application layer development, and the only thing I’ve found at that time is to use Classes.GetClass method, that is about 10 years ago. The problem for using this method is that we still need to put the classes.RegisterClass and Classes.UnregisterClass somewhere in our code. In my first version framework, I put it in a TDataModule that i design to store all common component there. But that was a huge mistake, my framework was not easy to develop and was not scalable. So I’ve upgraded my framework and this time i put both method in the initialization and finalization respectively in each unit. This method is working perfectly up until now. But some heavy discussion with my friend make my upgrade my knowledge again to get better way to do the same thing.

Continue reading

Print Carbon Copy with Fastreport

If you wish to create a report that need to be printed in multiple pages with most of the content is the same, here is one of the solution.
Before that i want to explain why i need this method, i need this method because sometimes we need a report that print the exact same data but need to be in multiple pages at once, we usually do this using a dot matrix printer and 2 or more sheet of pre printed carbon paper.
Now that i need to print on an empty paper but have the same effect like a carbon copy, i have to handle problem on how to print the exact data multiple times but with a little different information on each page. Examples :
Copy 1 : For Customer
Copy 2 : For Sales
Copy 3 : For Administrator
So to do this, here is what we need to do.
We will use PrepareReport to do the trick.
Here is the code sample
frxrprtReport.Variables.Variables[‘CarbonCopy’] :=  QuotedStr(‘Copy 1 : For Customer’);
frxrprtReport.Variables.Variables[‘CarbonCopy’] :=  QuotedStr(‘Copy 2 : For Sales’);
frxrprtReport.Variables.Variables[‘CarbonCopy’] :=  QuotedStr(‘Copy 3 : For Administration’);
So as you can see, you send the text for the information you need to put differently for each of carbon copy. That’s only an example, you can do a lot other the same way.
Notice that only the first PrepareReport is not using argument, because we want to clear previous report just to make sure
Iwan CS

Delphi XE Object Inspector Shortcut

Sometime i need to find an object properties on the object inspector pane quickly, before i found a new way, i use the scroll bar then search for the properties, now i found a new way.

To search for an object properties faster, you have to know the name of the properties first then you have to activate the Object Inspector Pane, either by pressing F11 or by selecting it using the mouse or by pressing the Return Key when focusing on the component, then the focus will be default to the object properties value, now to search for the property we want, you must press the TAB key then the focus will move to the object properties name. From there you can start typing the property name and it will focus to the first property that has the name similar to what you type

Iwan CS

Delphi XE Build Group

One feature i like in Delphi XE is the Build Group. This feature make me build or compile my multiple project, multiple module quickly. This feature will store projects and packages that we want to be Compiled/Build/Clear together into a Build Name. You can have multiple Build Group of course. With this feature i can just choose a build name, let say Client that will just compile the GUI package and the Client Application that my Project Group actually consist of more packages and application. This feature is very handy if you are working with a lot of projects and packages.

To use this feature:

– First click on the Show Build Group Pane on the project manager pane

– Then click on the New Build Group button

– Then set the build group name

– Then select all projects and packages that need to be in one build group

To use the build group

– First click on the Show Build Group Pane on the project manager pane

– Then choose the build name you want to build

– then click on the Compile/Build/Clear button on the build group pane

That’s all.

Iwan CS

Debugging multi project in Delphi XE

Currently my project is consist of 2 application which is the server application and the client application. Sometimes i need to debug both of them, so that i can debug the client and also debug the server application at the same time in which i can see what the client sent and what the server read and handle the client request.  This is very handy. This  debugging feature is supported since Delphi XE.

To debug both application at the same time, you need to do this:

– First you must compile all project, remember: compile all not build all

– Second, run the first application either by activating the project first then hit F9 or to right click on the project file then click on the Run menu, remember: not the Run Without Debugging menu

– Third, run the second application using the same method above

– It’s done, just make sure the order to run the application must be correct, for me, i must run the server application first then the client application

Note: if you already did all the step i mention above, even though you set the client application to active, the debugger will still stop on the server application too. So make sure you compile all your project

Hope this will help you if you need to do multiple debugging.

Iwan CS

Firebird 2.5 Released

Firebird Foundation mengumumkan peluncuran Firebird versi 2.5.

Press Release:

Release Note:

Launch Webminar:

Versi ini merupakan versi yang cukup di tunggu banyak penggemar Firebird, ada beberapa fitur penting yang ada di sini, seperti misalnya management user dapat di lakukan melalui query, support SMP, dll.

Saya pribadi sedang menunggu versi 3.0 yang akan support untuk multiprosesor lebih baik, dan terutama yang saya perlukan adalah embeded security database. Direncanakan fitur ini akan ada di versi 3.0. Tapi kita tunggu saja bagaimana kelanjutannya.

Info lebih lengkap, cek di