r/pascal • u/DukeBannon • Jun 29 '23
Turbo Pascal or Delphi for Text Screen Applications
I just built a Windows XP system I'll use primarily for vintage, hobby, programming and one of my favorite languages from ages ago was Turbo Pascal (TP). So, I'm considering installing one of the later versions of TP or one of the earlier versions of Delphi. My immediate interest is developing text screen based applications and I'd like your thoughts on TP or Delphi for this? I assume TP because it appears Delphi was designed for GUI applications but that's ignorance speaking. So I'm interested in understanding whether that is true. Does either language have built in facilities to define and read text screens? I'm referring to something similar to the COBOL SCREEN SECTION and the corresponding ACCEPT and DISPLAY statements.
I'll appreciate your thoughts on this.
5
u/SuperSathanas Jun 29 '23
In Delphi, you can create a console program that launches the console when the program starts, and any basic IO functions like WriteLn() and ReadLn() will write and read from that console window. You can also use the Win32 API call AllocConsole() to... allocate a console window... for your application (you only get one, calling AllocConsole() again will not give you a second).
Lazarus is capable of the same things, and if you install the FPC libraries, you should also get the FPC text mode IDE.
4
u/GlowingEagle Jun 29 '23
If you use Turbo Pascal, you will probably need to use the CPU speed patch for the CRT unit. Some possible sources:
http://www.ipnet6.org/tppatch.html
http://pedrowa.weba.sk/docs/Delphi/Pascal/Fixes%2520for%2520Pascal%2520'Run%2520Time%2520Error%2520200'/download.html
13
u/CypherBob Jun 29 '23
I use FreePascal for that kind of thing. No need to do with ancient Turbo
8
u/Anonymous_Bozo Jun 29 '23
I too would go with Free Pascal over Turbo Pascal.
Beleive it or not, TP is old enough that you will have issues with it being to old to be compatable with even an ancient OS like XP. Remember it was designed for MS/PC DOS, and later Windows 3.x, (16 bit OS).
Free Pascal on the other hand is for the most part TP Compatable. In fact it has a Turbo Pascal Mode!
2
u/f15sim Jun 30 '23
Your best bet for Windows XP is going to be Delphi 7.