| Delphi 5 Professional from Borland By
William LaMartin, Editor, Tampa PC Users Group |
![]() |
One of the prizes for second place in the recent FACUG web site contest was a copy of Borlands programming package Delphi 5 Professional. Quite a nice prize, since the discounted price of the package at CDWs online store is $540 (retail $799). There are two other versions available. Delphi 5 Standard costs $89 and Delphi 5 Enterprise is a whopping $2,468 at CDW. The Standard version is sort of like a learning edition and contains no database connectivity. It does allow you to create the small stand-alone EXEs that I mention below. The Enterprise edition contains one feature I would likeADO database connectivity, but there is enough in the Professional edition to keep me busy for a long time. So my hard work on the web site over the years has resulted in my getting a program that is also going to demand much work in the coming years.
I have been programming in Microsoft's Visual Basic for quite a number of years, so it is interesting to compare the two programming environments. Both Delphi and Visual Basic are considered Rapid Application Development environments, since they allow the programmer to get a working model of his application out much faster than, say, the C language would. Visual Basics programming language is based on BASIC. Delphis language is based on Pascal and is called Object Pascal. The program comes with a hard copy developers guide and an Adobe Acrobat version of the Object Pascal Programming Language guide. Of course, there is extensive online help. I judge the online help about as easy to use as the VB online help. Of course, I could always use more examples of code than is provided. It is one thing to see the definition of a particular function or statement and quite another to see an actual example in code of its use.
With Pascal being a new language to me, there is some learning to do. But I have written several small programs and one simple database program. The database program was the only one so far that has required an installation package for installation on another computer. With Visual Basic, if you want to install the program you have written on your development computer on a different computer you have to create an installation package using VBs Packaging and Deployment Wizard and then use that package to install your program on the other computer. And no matter how simple your program, the installation package is always going to be too large to fit on just one floppy.
And here is the beauty of Delphi 5. For simple applications you writethose not using ActiveX controls or database connectivityyou can simply take the resulting executable file, place it on another computer and run it. I think the base size of such an executable is around 300 KB 350 KB.
My first application consisted of creating a program that had a running clock, allowed the user to search a directory tree to select a text file or RTF file to open, then displayed that file so that the user could make modifications to the text and formatting and then choose from a directory tree where to save the file. It allowed him or her to again search a directory tree for a graphic file to display. Finally, there were several text boxes and drop down combo and list boxes where various information was displayed and the user could select from items in the combo and list boxes. Command buttons were supplied that when clicked on did various calculations with the items selected. The executable for all of this was around 600 KB and required no installation to run on another computer. I simply placed the application on the other computers desktop and double clicked on its icon to run it.
I have always wondered why something like the above couldnt be managed in Visual Basic. Now it doesnt matter. Delphi 5 has solved that problem for me. It will be interesting to see how many different computing tasks can be accomplished without having to create an installation package.
My second project was to duplicate a simple program I had written for someone in VB that ran on a client machine which each morning checked for a certain file that was on both the client machine and a server on the network. If the servers version of the file was more recent than the clients, then the program copied the servers version over the clients version. Of course, there was a setup menu where the user could look at a directory tree over the network and select the two locations of the file in question. In writing the code in VB I had used a call to a Windows API file copy function. Once I figured out how to do the same thing in Delphi, I noticed how much simpler it was in Delphi. Although I have done very little with such, it appears that in Delphi you have easier access to the Windows API (Application Programming Interface).
My third Delphi project was to display a database table (our membership list with addresses, etc.) and create a report based on certain fields that could then be printed. Setting this up was very similar to what you would do in Visual Basic 6. You drop data access components on a form and set certain of their properties so as to connect to the database table you want to use. The main difference in using Delphi is that my Microsoft Access Database is not "native" to this Borland product as it is to Microsoft VB, so I had to set up a Data Source Name (DSN) for the Members database using the OBDC entry in the Windows Control Panel (You probably wondered what it was for). That done, then the Borland database engine could use ODBC to connect to the Membership database.
The report was constructed using Delphis Quick Report feature, similar to VB 6s Data Report Designer. Here you place labels and text boxes (that get their values from the fields of the database ) on the report page either in the Header, Detail or Footer sections.
Once finished, it is time to create the installation package. To do this Borland has provided InstalledShield Express, a "lite" version of the installation program that you have seen many times when installing commercial programs. The first time I ran InstallShield Express I made two mistakes. I forgot to include the Borland Database engine as part of the package and I did not fill in one of three fields about the program where it asks for Project Name, Version, and Company. I left the company field blank. The program seemed to install fine but would produce a database type of error when I tried to run it. That was solved by including the Borland Database Engine as part of the installation. However, with that solved, I then noticed that the program did not appear in the list of programs that could be uninstalled in the Add/Remove section of the Windows Control Panel. A search of the InstallShield web site produced an article stating that this is exactly what would occur if you left any of the three fields mentioned above blank. So I went back and put in something for Company, and everything was then fixed.
I have much to learn and am really a beginner with Delphi and its Object Pascal language. However, I have been pleased how well my trials with it have gone so far. At this point, I cannot really compare it with VB very well, since I have been working with VB for many years, and I have only been using Delphi off and on for a month. But I do like the ability to make stand-alone executables of simple programs.
Also included in the package are JBuilder Sandard (Java development), C++Builder Standard (C++ programming) and HotMetal PRO 5.0 (Web Pages). I think, though, that I have more than enough on my hands without trying to use JBuilder to develop Java programs.
Perhaps after I have worked with Delphi for a much longer time, I will have material for another article.
I should note that the ability to access data sources using ADO (ActiveX Data Objects) can be added to Delphi 5 Professional for around $200. It is the main method I use in VB to connect to data sources, and in VB 6 it is free.