Convert Borland Pascal to GUI 32 bit Windows

I have to convert a Borland Pascal App into a Windows GUI app. The resulting app has to be compatible with:

All operating systems Windows 98,2000 XP.
Current data and index files.

Has to provide a GUI interface to the use.

I need to know which development environment I would need. Any thing I should be aware of while convcerting the source.
Who is Participating?
MannSoftConnect With a Mentor Commented:
Well I've never used Delphi 2.0, so I don't know what it is capable of, so it may indeed be good enough for you to do what you want.  I was just saying that you won't be able to recompile the BP program in Delphi, and have it become a GUI application without any changes.  No matter which version of Delphi you choose, you're going to have to manually create a GUI and add the code from your BP program behind the various events (mainly behind button clicks)

And about Delphi Studio, I think that is what they started calling versions 6 and 7 because they also came with the Linux equivalent of Delphi, called Kylix.  Unless you are interested in cross-platform development, you could probably save a few bucks by not getting a version with Kylix, because you won't need it.
Well, the easiest development environment to step up to would be Borland Delphi.  That way you wont have to rewrite your code in a whole new language, just maybe make a few changes here and there (some functions may have been renamed, for example Assign() is now AssignFile()).

One thing to be aware of though, you'll be going from 16bit to 32bit, which means some of your numeric data types will be changing size (Integer and Word become signed and unsigned 32bit respectively).  In most cases that isn't a big deal, but when you're working with binary files, it is a big deal (reading a single integer with BP will read 2 bytes, with Delphi it'll read 4).  So you'll have to take that into consideration when working with your data files.  If they are typed files and you have records, it's actually an easy fix.  For example:

{ BP Record }
type MyRecord = Record
  MyInt: Integer;
  MyWord: Word;

{ Delphi Equivalent }
type MyRecord = Packed Record
  MyInt: SmallInt;
  MyWord: SmallWord;

Also notice the keyword Packed in the type declaration.  BP used packed records by default, but to be more efficient (speed not size wise) Delphi uses record alignment by default.  This will also create problems reading typed files, so the Packed keyword solves that.

There are many other minor issues to consider (for example "set of" doesn't work the same, but isn't commonly used so might not be an issue for you), but I think the renamed functions and different data sizes are the main ones to be aware of.
IdaracAuthor Commented:
A bit more about actual data files.

Is is safe to assume that any data files the Pascal can work with Delphi can also work with?

I believe there is a packing and reindexing routine with the existing app. What would that tell me about what type of data files I have to work with?

The dataset I was given has extensions of *.dta, *.kx and .xx.

A bitmore about the Pasal project.
I have never used Delphi before how do I get the Pascal source into Delphi?
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Yes, it is safe to assume that any data file BP could read, Delphi can also read.  As I said you just need to watch out for some of the differences, like datatype sizes.

With packing and reindexing, it sounds like they are probably some sort of typed files.  When records are deleted from typed files, the most efficient (speed wise) thing to do is to mark the record as deleted, but to actually leave it in the file.  Then when a new record is added it can just overwrite the old deleted record.  But if new records are rarely added, the file is like swiss cheese with holes everywhere after awhile.  Packing the file would mean moving the remaining good records to the front of the file, and then all the deleted records would be on the end and could be truncated (this is efficient, size wise).  Of course there are more interpretations of "packing and reindexing", so this may be way off base.

As for those extensions, they mean nothing to me.  If it's a proprietary application, they could have chosen anything so it doesn't really indicate much.

And as for getting the source into Delphi, it's probably going to be a lot of cutting and pasting.  In the BP program, for example, you may have had a block of code that ran when the 'R' key was pressed.  In your Delphi application you'll have a button on a form to perform the action that the 'R' keypress used to, and so you would paste the code into that button's onClick event handler.

Any code not associated with an event (such as helper functions) could still be kept in separate units, just like you would have done in BP.
IdaracAuthor Commented:
I just confirmed that the BP code is version 7.

I have Delphi 2.0 so I am going to try and bring in the version 7 code.

Does Delphi and BP both have a project persay where you load it based on the project?

I am going to install Delphi 2.0 on my computer and try and open the BP 7 project. Anything I should do before I try?
I dont think BP had a project option, you just loaded up the main source file and hit compile.  I've never used anything as old as Delphi 2.0, but even if it does compile the BP code with no changes, it's not going to be a GUI program.  It's definitely going to take a bit of work to get that part done.
IdaracAuthor Commented:
I have Delphi 2.0 here so I thought I would start with that.

So it seems I need a version of Delphi.

My last question to you is to help me make some sense of the Delphi versions. I see Delphi studio out there. Which version should I start with?

I will then close this question and start a new one when I actually start converting the program.
IdaracAuthor Commented:

Thanx for your help.

I will probably opening another question once I start the conversion.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.