Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TP/DOS compatibility code 1

Status
Not open for further replies.

Glenn9999

Programmer
Jun 19, 2004
2,311
US
I posted a couple of FAQs, which have some code I worked on here that I wanted to share. Hopefully it will help someone - if someone tries them and runs into problems, please let me know. I tried to make them act as much as the Turbo Pascal versions as I could - the idea is that one should generally be able to take a Turbo/Borland Pascal source file and compile it into Delphi with these without too much trouble.

faq102-7109
faq102-7111

(I tried doing Printer as well, but I couldn't make the VCL print dialogs work right without the presence of a form - I might try it again sometime.)

----------
Measurement is not management.
 
I do a fair bit with console applications - the CRT unit will come in very handy.

Thank you!
 
You are allowed to use forms in Console mode applications. It doesn't have to be visible though. ;-)

But the Lst file is really just a direct line-printer text file. You might want to check out the simple OpenPrinter() and WritePrinter() functions. Another useful one is the poorly-named ExtEscape().


Sweet units. Your readkey function is a little too limited, though (it is missing a lot of codes). You can get the complete list from the back of an old TP4 manual. (Or if you like, I can send it to you...)

Hope this helps.
 
But the Lst file is really just a direct line-printer text file.

Correct. But I wanted to have it a little nicer than to just print to the default printer (as the version in the Delphi Printers unit does) - I wanted the print dialogs to enable the user to select a printer.

Your readkey function is a little too limited, though (it is missing a lot of codes). You can get the complete list from the back of an old TP4 manual.

I'm sure they are limited due to the documentation I was able to get about the old units (I don't have Turbo Pascal manuals anymore, and just have Turbo Pascal 7 - that's why I said "Turbo Pascal", because that was what I tested against *). The main problem here is that what you see in Readkey was all I could scrape together, documentation wise. If you have documentation on what should be returned for each key, I would be glad to see it and update the readkey function.

* The testing method was to take source compilable in TP7 and then compile it in Delphi using the units that were posted, and then both programs should behave identically for the implemented functions.

----------
Measurement is not management.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top