Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

BP 7 to Delphi

137 views
Skip to first unread message

Rigas Ioannides

unread,
May 24, 2003, 7:30:33 PM5/24/03
to
Hello all,
I got a source code written for console application (MS-DOS) using BP 7.0
with objects. I want to compile it in Delphi and make it 32-bit.

I tried to do it but it gives me some errors, in standard units (probably
Delphi uses other better units) and in syntax.

Does anybody know a good reference that I can use to convert my code?

Thank you

Rigas

Scott Duncan

unread,
May 25, 2003, 12:44:36 AM5/25/03
to
maybe this will help http://www.merlyn.demon.co.uk/del-prgg.htm
"Rigas Ioannides" <r.ioa...@ntlworld.com> wrote in message
news:3ecffffc$1...@newsgroups.borland.com...

Rudy Velthuis (TeamB)

unread,
May 25, 2003, 4:41:40 AM5/25/03
to
In <3ecffffc$1...@newsgroups.borland.com>, Rigas Ioannides wrote:

> Hello all,
> I got a source code written for console application (MS-DOS) using BP
> 7.0 with objects. I want to compile it in Delphi and make it 32-bit.
>
> I tried to do it but it gives me some errors, in standard units
> (probably Delphi uses other better units) and in syntax.

How big is it? If you are allowed to, and want to, you could zip it up
and post it to borland.public.attachments. Just write a little note here
that you did so.
--
Rudy Velthuis (TeamB)

"Ask her to wait a moment - I am almost done."
-- Carl Friedrich Gauss (1777-1855), while working, when informed that
his wife is dying

Thomas Mueller

unread,
May 25, 2003, 7:18:51 AM5/25/03
to
Hi,

Rigas Ioannides wrote:

> I got a source code written for console application (MS-DOS) using BP 7.0
> with objects. I want to compile it in Delphi and make it 32-bit.

What is the primary objective here? Delphi or 32 bit? If it is the latter,
you could try to use Virtual Pascal (www.vpascal.com) instead because then
it would probably mostly be a recompile with only minor changes. Virtual
Pascal is 99,9% compatible to Borland Pascal 7, most of the programs I
tried compiled without any change at all.

twm


Rene Tschaggelar

unread,
May 25, 2003, 9:56:14 AM5/25/03
to


Even while the syntax is similar, the conversion is not trivial.
In case the application requires some user interaction, a
GUI application should be considered and not a console
mode application.

The main difference is the changed logic. While the BP is
procedural, meaning the program counter is just somewhere
over time, programming for windows is event driven and you
know that the program counter is mainly in the idle loop
of the operating system.

Some datatypes did change and except for the toy windows, the
data size restrictions are almost gone.

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
& commercial newsgroups - http://www.talkto.net

The DeerBear

unread,
May 25, 2003, 10:25:25 AM5/25/03
to
Rigas Ioannides wrote:
> Does anybody know a good reference that I can use to convert my code?

Hi,

I did many years programming in Turbo Pascal and then in Borland Pascal.

The main issue here is that Borland Pascal is DOS, while Delphi is Windows.
This may seem obvious, but it takes some "heavy" considerations along.

There's alot that remains unspecified of your post.
A couple of obvious questions are: is it a Turbo Vision app?
Object Professional one?

Is it composed of TSR modules?

Does it overload interrupts?

Is there any BASM routine in it?

Do you use strings heavily in it?

Is it made with overlays?

Does it run in real or DPMI mode?

And that's just to start...

> Thank you

Welcome,

> Rigas

Andrew

Loren Pechtel

unread,
May 25, 2003, 9:32:43 PM5/25/03
to
On Sun, 25 May 2003 15:56:14 +0200, Rene Tschaggelar
<tscha...@dplanet.ch> wrote:

>Even while the syntax is similar, the conversion is not trivial.
>In case the application requires some user interaction, a
>GUI application should be considered and not a console
>mode application.
>
>The main difference is the changed logic. While the BP is
>procedural, meaning the program counter is just somewhere
>over time, programming for windows is event driven and you
>know that the program counter is mainly in the idle loop
>of the operating system.
>
>Some datatypes did change and except for the toy windows, the
>data size restrictions are almost gone.

I'm also in the need of a quick-and-dirty port of some code to
get it on a Windows platform. It's currently BP7. Should I go to
Windows mode (Note: I have no experience with Windows without
Delphi's types propping things up.), Delphi 1 or Delphi 7? I expect
the result to be a bit ugly, still procedural using a polling loop.
(Yes--a drag on the machine. However, in most situations this will be
the main app running.)

Rene Tschaggelar

unread,
May 26, 2003, 11:13:50 AM5/26/03
to


You checked the comments of 'TheDeerBear', did you ?

I don't know Delphi 1, just heard it to be 16 bit. If possible,
I'd go for Delphi 7, GUI mode. I cannot imagine a gain when using
the console mode. A lot of things are solved much nicer in the GUI
mode. With some effort you can also get rid of the polling.

What hardware do you poll and what are the timing constraints on it ?

Loren Pechtel

unread,
May 27, 2003, 10:51:56 AM5/27/03
to

The thing is I'm interersted in getting it running with a
minimum of effort, not in the best result--I'll be happy if it runs as
well as the dos version. A full rewrite port is being done but being
stuck on dos is being quite a headache, if I could quickly get the old
code running under Windows it would help.

Polling--mostly just the keyboard. I'm figuring that if there's
no key available, sleep for say 10ms.

Rene Tschaggelar

unread,
May 27, 2003, 2:42:59 PM5/27/03
to

Isn't that the purpose of the console mode ? You may have to have
a look at that. Then there are replacement units for the graphic
unit and so on.

> Polling--mostly just the keyboard. I'm figuring that if there's
> no key available, sleep for say 10ms.

I'm not sure, the keyboardevent might even be faster than
polling the keyboard.

In DOS/BP7 time there was the rule that you spend >= 70% on the
userinterface. With Delphi this ratio is much better towards
your own code as many userinterface functionalities can just
be pulled down. It is mainly the userinterface that blocks porting
and not your functionality.
So it might well be that your functionality can be attached to a new
userinterface with little effort.

Rene

Guenther Wimpassinger

unread,
May 27, 2003, 3:38:06 PM5/27/03
to

"Rigas Ioannides" <r.ioa...@ntlworld.com> schrieb

> Hello all,
> I got a source code written for console application (MS-DOS) using BP 7.0
> with objects. I want to compile it in Delphi and make it 32-bit.
>

What's about application written in Turbo Pascal for Windows (1.5) or so?

I can open it in D7 but the compiler disables hisself (no compliation is available)

bye
Guenther

p.s. I don't really need it, but it would be nice to know :-)

Mike Williams (TeamB)

unread,
May 27, 2003, 3:48:10 PM5/27/03
to
On 27 May 2003, "Guenther Wimpassinger" <marsianer...@hotmail.com>
wrote:

> Does D1 have some "import" routines for old TPW apps? or Conversion?

It's been so long I don't remember. I believe that D1 did support OWL so
it may be easier than you think.

--
-Mike (TeamB)

Guenther Wimpassinger

unread,
May 27, 2003, 3:43:59 PM5/27/03
to

"Mike Williams (TeamB)" <mi...@remove.aps-soft.com> schrieb im Newsbeitrag news:Xns93889F8538...@207.105.83.65...

> > What's about application written in Turbo Pascal for Windows (1.5) or
> > so?
>

> Compilation is only available for DPR files, not PAS files. If you give
> the main program a DPR extension you'll be able to tell Delphi to compile
> it. It probably won't get very far, however. <g>

Mike Williams (TeamB)

unread,
May 27, 2003, 3:40:51 PM5/27/03
to
On 27 May 2003, "Guenther Wimpassinger"
<marsianer...@hotmail.com> wrote:

> What's about application written in Turbo Pascal for Windows (1.5) or
> so?
>
> I can open it in D7 but the compiler disables hisself (no compliation
> is available)

Compilation is only available for DPR files, not PAS files. If you give

the main program a DPR extension you'll be able to tell Delphi to compile
it. It probably won't get very far, however. <g>

--
-Mike (TeamB)

Guenther Wimpassinger

unread,
May 27, 2003, 4:33:36 PM5/27/03
to

"Mike Williams (TeamB)" <mi...@remove.aps-soft.com> schrieb

> > Does D1 have some "import" routines for old TPW apps? or Conversion?


>
> It's been so long I don't remember. I believe that D1 did support OWL so
> it may be easier than you think.

I will give it a try tonight :-)

bye guenther


Peter Below (TeamB)

unread,
May 28, 2003, 4:50:30 PM5/28/03
to
In article <3ed3...@newsgroups.borland.com>, Guenther Wimpassinger wrote:
> Does D1 have some "import" routines for old TPW apps? or Conversion?

THere was a conversion tool, as far as i remember, that was supposed to
turn dialog resources into Delphi forms. It did not work too well, though.
And it did not do any code conversion anyway.
>

--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be


Rigas Ioannides

unread,
Jun 24, 2003, 5:27:43 PM6/24/03
to
Hello,
There is some user interaction I have to do. Actually there is a dialog with
5-6 options where the user chooses them using the cursor.
I cannot find similar commands-functions in Delphi (as the Keypressed) and I
am trying to do it using the forms and the Tbuttons which I have no idea
about them...

Is there any other way?

I use strings heavily but I have already managed to compile all of it
although it does not run as it should. For example I cannot choose one of
the options (it takes the default value) I cannot move the cursor along the
options, and I cannot clear the screen or store it.

Thus I have some work to do. Actually I think that by using Delphi I will
get the advantages of 32-bit, no restrictions to memory, array sizes, faster
e.t.c.

Do oyu think that I can use a form and Tbuttons with my source code, compile
it all together in order to replace the functions that I cannot implement
with Delphi source code alone?

Thank you,

"The DeerBear" <rain...@tin.it> wrote in message
news:3ed0...@newsgroups.borland.com...

Henry B

unread,
Jun 25, 2003, 3:14:44 AM6/25/03
to
Rigas Ioannides <r.ioa...@ntlworld.com> wrote

> There is some user interaction I have to do. Actually there is a
> dialog with 5-6 options where the user chooses them using the
> cursor. I cannot find similar commands-functions in Delphi (as the
> Keypressed) and I am trying to do it using the forms and the
> Tbuttons which I have no idea about them...

I went down this road many moons ago when I began converting my BP7
programs to Delphi 1

What are you trying to do?

Convert a plain Pascal DOS-mode app (ie no Turbo Vision or TP Windows
libraries) to console mode?

Convert a Turbo Vision App to a console?

Or convert a TP for Windows app to compile in Delphi?

If the first or second, the main problem is that Delphi does not have
the libraries to support this type of thing in console mode.

You will find a link to a replacement CRT unit on my Delphi links page
at http://www.hotkey.net.au/~hambar/habit/delfstuf.htm but, I think
you will need much more than this.

"The DeerBear" made some excellent points.

> Do oyu think that I can use a form and Tbuttons with my source code,
> compile it all together in order to replace the functions that I
> cannot implement with Delphi source code alone?

In any case, plain Pascal DOS mode to console, TV to console or TP-Win
to Delphi GUI, my advice is the same.

Delphi excels at GUI, so forget about trying to do a direct
conversion. Get yourself a good book on working with Delphi, or check
out some of the links to tutorials and on-line-books on my links page.

Learn how to build simple GUI apps in Delphi, then start rebuilding
your application from scratch, using the much more powerful Windows
GUI. and Delphi components. Don't try to include every Windows goodie,
just stick to replicating what you had in the BP7 version. You can
embellish it after it's all working OK.

Build the user-interface first and then attach the behind-the-scenes
code for the event-handlers later. You will probably find that you can
re-use most 7of your Pascal code.

It may seem a lot more work in the short-run but you will find that it
is really worthwhile to take the time to learn to use Delphi properly.

IMO, Delphi console mode is not at all suitable for programs with much
user interaction. Only consider it for testing code snippets or
applications where user-interaction (such as selecting from menu
options) is not required.

If you are familiar with Turbo-Vision then you will be familiar with
Object-Oriented and Even-driven design but be warned, you will have to
relearn many things since Delphi/Windows often does things in a quite
different way.


--
Henry Bartlett
HABit utilities ( http://www.hotkey.net.au/~hambar/habit/ )
email: ham...@Spamlock.microtech.com.au.
Please remove the "Spamlock." from my address when replying.

Peter Below (TeamB)

unread,
Jun 25, 2003, 6:17:34 AM6/25/03
to
In article <3ef8c182$1...@newsgroups.borland.com>, Rigas Ioannides wrote:
> There is some user interaction I have to do. Actually there is a dialog with
> 5-6 options where the user chooses them using the cursor.
> I cannot find similar commands-functions in Delphi (as the Keypressed) and I
> am trying to do it using the forms and the Tbuttons which I have no idea
> about them...

If you port old TP or BP7 code to Delphi it is usually best to rewrite the
user interface completely. Windows simply has a totally different programming
model than DOS had. You do not sit in a loop and poll for user input, you ract
to events generated by user input. The loop is actually still there, but
buried deep in the VCL.

So create a new application in Delphi. This gets you an empty form. Drop a
TRadioGroup on it, hit F11 to switch to the Object Inspector. Find the
radiogroups Items property and double-click on it to call up the items editor.
Type in the names of your options, one per line. Close the editor with OK: you
now have a radio button for each option. Adjust the groups size and position
to taste. Drop a TButton on the form, switch to the OI and change its caption
as needed. Doubleclick on the button, this generates the skeleton for an event
handler for the buttons OnClick event in your code editor. There you place the
code to start the processing. The option selected by the user can be had from
the radiogroups ItemIndex property (zero-based, like nearly all indices in
Delphi). To output results you drop a TMemo on the form, add text to this memo
in code using memo1.lines.add(...a string here ... );

> Is there any other way?

If your BP program used the CRT unit for I/O: there are a couple of Win32
ports for this, based on the Win32 console API.

Crt32: http://www.zieglersoft.dk
http://www.mindspring.com/~efd/tools.htm
http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=19810
WinCRT http://www.simtel.net/pub/pd/11929.html

You would create a console project in Delphi in this case
(File->New->Other->Console application).

Don't forget that Delphi has an online help. Part of it is an abbreviated
version of the Delphi Developers Guide (which you may have got in your Delphi
package, depending on which edition you bought). Start on the Contents page of
the online help and read through the "Programming with Delphi" booklet.

Rigas Ioannides

unread,
Jun 25, 2003, 4:03:18 PM6/25/03
to
Thank you Henry and Peter. Thus the conclusion is that I will have to
rebuild my program in Delphi (especially the parts where user interaction is
required) and use the BP code for the math processing.

Actually I have a real time application built in BP 7 and I want to
transform it into a console application in Delphi. I know I could do it with
a 32-bit Pascal compiler but I found it as a good opportunity to learn a bit
about Delphi as well.

Thank you,

Rigas.

"Peter Below (TeamB)" <10011...@compuXXserve.com> wrote in message
news:VA.0000a01...@nomail.please...

Peter Below (TeamB)

unread,
Jun 25, 2003, 5:27:49 PM6/25/03
to
In article <3ef9...@newsgroups.borland.com>, Rigas Ioannides wrote:
> ctually I have a real time application built in BP 7
>

I hope you are aware that Windows is a fairly rotten platform for real
real-time applications. It is rather diffcult to get guaranteed
response times for a user-level application under Windows since it is a
multitasking OS. You don't have control of the hardware under Windows
like you had under DOS.

Dr John Stockton

unread,
Jun 25, 2003, 1:52:47 PM6/25/03
to
JRS: In article <3ef9...@newsgroups.borland.com>, seen in news:borland
.public.delphi.language.objectpascal, Henry B <ham...@Spamlock.microtech
.com.au> posted at Wed, 25 Jun 2003 17:14:44 :-

>
>I went down this road many moons ago when I began converting my BP7
>programs to Delphi 1
>
>What are you trying to do?
>
>Convert a plain Pascal DOS-mode app (ie no Turbo Vision or TP Windows
>libraries) to console mode?
>
>Convert a Turbo Vision App to a console?
>
>Or ...

>
>If the first or second, the main problem is that Delphi does not have
>the libraries to support this type of thing in console mode.


For programs with much user interaction, including TV, I don't doubt it.

But for programs which largely read process and output data, it is not
necessarily so. Many of my structurally-simpler Pascal programs run
without change in Delphi 3 console mode, and others have been adapted
with no great difficulty to work with both compilers.

Moderate pessimism is justified, but not excessive pessimism!

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)

Dr John Stockton

unread,
Jun 26, 2003, 8:42:45 AM6/26/03
to
JRS: In article <VA.0000a02...@nomail.please>, seen in
news:borland.public.delphi.language.objectpascal, Peter Below (TeamB)
<10011...@compuXXserve.com> posted at Wed, 25 Jun 2003 23:27:49 :-

>In article <3ef9...@newsgroups.borland.com>, Rigas Ioannides wrote:
>> ctually I have a real time application built in BP 7
>>
>
>I hope you are aware that Windows is a fairly rotten platform for real
>real-time applications. It is rather diffcult to get guaranteed
>response times for a user-level application under Windows since it is a
>multitasking OS. You don't have control of the hardware under Windows
>like you had under DOS.

Agreed. Are things better with Kylix and Linux, suitably configured?

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Delphi 3 Turnpike 4 ©
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htm> clpdmFAQ;
<URL:http://www.borland.com/newsgroups/guide.html> news:borland.* Guidelines

Peter Below (TeamB)

unread,
Jun 26, 2003, 2:23:33 PM6/26/03
to
In article <vF1nNbLF...@merlyn.demon.co.uk>, Dr John Stockton wrote:
> Agreed. Are things better with Kylix and Linux, suitably configured?

No idea, i can hardly spell Linux <g>.

George Christoforakis

unread,
Jun 30, 2003, 7:53:05 AM6/30/03
to
The only thing you need to do is to transfer the actual code that does all
the work into Delphi.

Regarding the Buttons and the rest of the user interaction, have a look at
the events and how to build or use them. This would help you a lot to
understand user interaction under GUI environments.

George Christoforakis

"Rigas Ioannides" <r.ioa...@ntlworld.com> wrote in message

news:3ef8c182$1...@newsgroups.borland.com...

Rigas Ioannides

unread,
Jun 30, 2003, 8:33:34 AM6/30/03
to
So George you recommend that I will make the minor changes to the code that
does all the processing (like string replaced by shortstring e.t.c.) and
then use the event handle functions in Delphi to replace the procedures that
I have in BP7.0 for the user interaction procedures and then try to connect
the processing code with those event handle functions?
That is what I wanted to understand actually :-)
I just wanted to know if it is possible to do so.

Thank you,

"George Christoforakis" <George.Chr...@RatioGroup.com> wrote in
message news:3f00...@newsgroups.borland.com...

George Christoforakis

unread,
Jun 30, 2003, 9:30:54 AM6/30/03
to
Yeap, it is possible to do it :-)
All Delphi versions from 3 or 4 better and upwards would cover you.

George Christoforakis.

"Rigas Ioannides" <r.ioa...@ntlworld.com> wrote in message

news:3f002d49$1...@newsgroups.borland.com...

0 new messages