GRAPHICAL STRING ON SCREEN WITH OUTTEXTXY - TURBO PASCAL 7.1 lazarus / 21-General ---------------------------------------------------------------------- Quazatron · 2022-06-11 14:05 HELLO EVERYONE! I am still programming in old TURBO PASCAL 7.1, and I am having troubles getting an alternative OUTTEXTXY that could sent the text to a virtual page, instead to VGA, as, by default, this procedure does with no way to change the destination where the string will be shown. Any ideas on how to overcome this? I'd like to still use settextstyle to set the font, but I'd love to find a way to do an "outtextxy" where I could change the destination of text. Any similar procedure in any other GRAPH alternative unit? Cheers! THANKS everyone in advance! ---------------------------------------------------------------------- marcov · 2022-06-11 14:15 This is not a Turbo Pascal forum, but a Free Pascal forum. Free Pascal comes with its own Graph unit. ---------------------------------------------------------------------- Quazatron · 2022-06-11 14:16 Quote from: marcov on June 11, 2022, 04:15:19 pmThis is not a Turbo Pascal forum, but a Free Pascal forum. Free Pascal comes with its own Graph unit. I know, but I have no better forums to ask this. After all, Free Pascal derives from Pascal. If I could get any help... By the way.. does FREE PASCAL GRAPH unit include anything similar to OUTTEXTXY that I can copy/paste to TP? Thanks in advance. ---------------------------------------------------------------------- marcov · 2022-06-11 14:21 Quote from: Quazatron on June 11, 2022, 04:16:39 pmQuote from: marcov on June 11, 2022, 04:15:19 pmThis is not a Turbo Pascal forum, but a Free Pascal forum. Free Pascal comes with its own Graph unit. I know, but I have no better forums to ask this. After all, Free Pascal derives from Pascal. If I could get any help... Even because you have no better forums, that still makes it off-topic. Note that FPC doesn't base itself on TP's sources in any way. QuoteBy the way.. does FREE PASCAL GRAPH unit include anything similar to OUTTEXTXY that I can copy/paste to TP? It contains it, but I doubt that it will be a copy and pastable due to TP's byzantine BGI structure and 16/32-bit and possible dialectal issues (FPC supports the whole of Delphi and extensions to both TP and Delphi) Text depends on the stroked font support, and FPC's outtextxy uses its own code for that, not BGI. ---------------------------------------------------------------------- MarkMLl · 2022-06-11 16:19 Quote from: Quazatron on June 11, 2022, 04:16:39 pmI know, but I have no better forums to ask this. What do you expect if you insist on using a development tool that was obsolete 20 years ago? Quote After all, Free Pascal derives from Pascal. Stop whining. The Free Pascal Compiler- count the words, there's three of them- is an /implementation/ of Pascal. Object Pascal, which is one of the modes and generally matches Delphi, is a derivative. As is the language supported by Turbo Pascal. https://www.freepascal.org/docs- html/current/prog/progsu104.html#x112-1130001.3.21 Make some effort to compile your program using it, and you'll probably find plenty of people happy to help. After all, unlike Turbo Pascal, FPC is still very much alive. See https://www.freepascal.org/docs.html for documentation which should answer your question about supported procedures (use the online docs, the PDF links are broken). MarkMLl ---------------------------------------------------------------------- wp · 2022-06-11 16:40 Quote from: Quazatron on June 11, 2022, 04:05:32 pmI am still programming in old TURBO PASCAL 7.1, and I am having troubles getting an alternative OUTTEXTXY that could sent the text to a virtual page, instead to VGA, as, by default, this procedure does with no way to change the destination where the string will be shown. Any ideas on how to overcome this? I'd like to still use settextstyle to set the font, but I'd love to find a way to do an "outtextxy" where I could change the destination of text. Sorry, I don't understand what the issue is. Basically the old graph unit is supported by FPC, however, in a restricted way (no BGI drivers, no CHR fonts). IIRC, it's much slower than the original. There is another unit, wingraph (wingraph, http://math.ubbcluj.ro/~sberinde/wingraph/) which appeared to be better at the time I tested it (but I may be mistaken by memory). And there is also a primitive port to Lazarus by myself which allows you to draw BGI commands inside an LCL window (https://github.com/wp- xyz/LazBGI). ---------------------------------------------------------------------- Leledumbo · 2022-06-13 04:52 Quote from: MarkMLl on June 11, 2022, 06:19:30 pmWhat do you expect if you insist on using a development tool that was obsolete 20 years ago? 30, it's 2022 ---------------------------------------------------------------------- Roland57 · 2022-06-13 06:59 Quote from: wp on June 11, 2022, 06:40:30 pmThere is another unit, wingraph (wingraph, http://math.ubbcluj.ro/~sberinde/wingraph/) which appeared to be better at the time I tested it (but I may be mistaken by memory). And there is also a primitive port to Lazarus by myself which allows you to draw BGI commands inside an LCL window (https://github.com/wp-xyz/LazBGI). For completeness, there is also the excellent ptcGraph unit, which is shipped with FPC. So many possibilities! ---------------------------------------------------------------------- MarkMLl · 2022-06-13 07:53 Quote from: Leledumbo on June 13, 2022, 06:52:23 amQuote from: MarkMLl on June 11, 2022, 06:19:30 pmWhat do you expect if you insist on using a development tool that was obsolete 20 years ago? 30, it's 2022 It's a 30-year-old product, but Borland made downloads free roughly 20 years ago. I was using that as the point at which it was realistically obsolete. MarkMLl ---------------------------------------------------------------------- marcov · 2022-06-13 08:04 Quote from: MarkMLl on June 13, 2022, 09:53:39 amIt's a 30-year-old product, but Borland made downloads free roughly 20 years ago. I was using that as the point at which it was realistically obsolete. Not free that I know for the last series. The newest free one is 5.5, and one French version of 7 for a while.  But both free products were limited, without protected mode support etc. ---------------------------------------------------------------------- MarkMLl · 2022-06-13 08:33 Quote from: marcov on June 13, 2022, 10:04:19 amNot free that I know for the last series. The newest free one is 5.5, and one French version of 7 for a while.  But both free products were limited, without protected mode support etc. My mistake. I think that was based on a cursory reading of the Wikipedia page to check dates, where it says that (for some reason) the French variant was made available... and even that looks like second-hand news via archive.org. In any event: well and truly obsolete by now, particularly if being run on a comparatively recent operating system. MarkMLl ---------------------------------------------------------------------- PascalDragon · 2022-06-13 12:38 Quote from: wp on June 11, 2022, 06:40:30 pmBasically the old graph unit is supported by FPC, however, in a restricted way (no BGI drivers, no CHR fonts). IIRC, it's much slower than the original. CHR fonts are supported. Also the performance totally depends on the platform and which specific Graph unit you use (e.g. on a current OS I'd always suggest to use PtcGraph). ---------------------------------------------------------------------- Quazatron · 2022-06-13 13:22 Thank you all guys, but I see that this topic is way off-topic now. I appreciate all answers but, even if TP is no longer used, it is used by me and, certainly, some others also. And I guess there is a whole retro community that still loves TP, Basic, Cobol, C, etc. Thanks anyway, even if none are able to help. ---------------------------------------------------------------------- SymbolicFrank · 2022-06-13 13:56 @Quazatron, did you actually try and recompile it in Free Pascal, with the character-graphics GUI? You don't have to use Lazarus, if you don't want to. And at that moment it looks and feels like an upgraded Turbo Pascal, although not 100% compatible (as explained), because the platform that needs to run is only available through emulation (DOSBox etc). The OS might still run on some actual hardware, but if you want pixel graphics, it becomes a lot harder. Your program runs natively on modern systems, from a Raspberry Pie to a high-end system with only small modifications through Free Pascal. In short, it can be as retro as you want it to be, without requiring ancient hardware. ---------------------------------------------------------------------- PascalDragon · 2022-06-14 07:04 Quote from: SymbolicFrank on June 13, 2022, 03:56:41 pm@Quazatron, did you actually try and recompile it in Free Pascal, with the character- graphics GUI? You don't have to use Lazarus, if you don't want to. And at that moment it looks and feels like an upgraded Turbo Pascal, although not 100% compatible (as explained), because the platform that needs to run is only available through emulation (DOSBox etc). The OS might still run on some actual hardware, but if you want pixel graphics, it becomes a lot harder. Well, FPC does support compiling to 16-bit DOS including the Graph unit if one wants to... ---------------------------------------------------------------------- Quazatron · 2022-06-14 23:23 Quote from: PascalDragon on June 14, 2022, 09:04:20 amQuote from: SymbolicFrank on June 13, 2022, 03:56:41 pm@Quazatron, did you actually try and recompile it in Free Pascal, with the character- graphics GUI? You don't have to use Lazarus, if you don't want to. And at that moment it looks and feels like an upgraded Turbo Pascal, although not 100% compatible (as explained), because the platform that needs to run is only available through emulation (DOSBox etc). The OS might still run on some actual hardware, but if you want pixel graphics, it becomes a lot harder. Well, FPC does support compiling to 16-bit DOS including the Graph unit if one wants to... Unfortunately, none of my works compile on Free Pascal. A bunch of errors show up and I'd take an eternity to "reajusting" the code. ---------------------------------------------------------------------- Handoko · 2022-06-15 02:34 Quote from: Quazatron on June 11, 2022, 04:05:32 pmI am still programming in old TURBO PASCAL 7.1, and I am having troubles getting an alternative OUTTEXTXY that could sent the text to a virtual page, instead to VGA, as, by default Maybe you can consider BGRABitmap. Here has a tutorial showing how to write text on a TBGRABitmap before drawing it to the screen: https://wiki.freepascal.org/BGRABitmap_tutorial_12 BGRABitmap is an easy to use alternative to TCanvas/TImage, it has/supports svg, sprite animation, virtual screen. Here is the wiki page: https://wiki.freepascal.org/BGRABitmap And this is the tutorials page: https://wiki.freepascal.org/BGRABitmap_tutorial Unfortunately BGRABitmap cannot be used in Turbo Pascal. Maybe this is the time to port your code to more modern cross-platform Pascal, Lazarus. ---------------------------------------------------------------------- MarkMLl · 2022-06-15 06:55 Quote from: Quazatron on June 15, 2022, 01:23:13 amUnfortunately, none of my works compile on Free Pascal. A bunch of errors show up and I'd take an eternity to "reajusting" the code. No you wouldn't, because you have people here interested in helping /PROVIDED/ that they're being asked to help with FPC problems. Can you start off with something simple and post the program and error output? it might turn out to be something simple like needing to set a compiler mode or override. MarkMLl ---------------------------------------------------------------------- PascalDragon · 2022-06-15 07:07 Quote from: Quazatron on June 15, 2022, 01:23:13 amQuote from: PascalDragon on June 14, 2022, 09:04:20 amQuote from: SymbolicFrank on June 13, 2022, 03:56:41 pm@Quazatron, did you actually try and recompile it in Free Pascal, with the character-graphics GUI? You don't have to use Lazarus, if you don't want to. And at that moment it looks and feels like an upgraded Turbo Pascal, although not 100% compatible (as explained), because the platform that needs to run is only available through emulation (DOSBox etc). The OS might still run on some actual hardware, but if you want pixel graphics, it becomes a lot harder. Well, FPC does support compiling to 16-bit DOS including the Graph unit if one wants to... Unfortunately, none of my works compile on Free Pascal. A bunch of errors show up and I'd take an eternity to "reajusting" the code. You did try with a MS-DOS cross compiler? And with $mode tp? And also with main if you happen to use inline assembly? Cause then the compatibility with TP code is much higher then on other targets (cause some constructs simply don't work on (all) other platforms, like Ports). It would also help if you'd provide examples that fail. ---------------------------------------------------------------------- Thaddy · 2022-06-15 08:35 Quote from: Quazatron on June 15, 2022, 01:23:13 amUnfortunately, none of my works compile on Free Pascal. A bunch of errors show up and I'd take an eternity to "reajusting" the code. If you provide us with your compiler settings.... We are able to help you. E.g. I have Turbopascal running in DosBox and almost all my really old code simply works, also with a properly set up cross compiler with FPC the code simply works. You should not "re-adjust", but provide us with example and compiler settings. That is all. But do not expect using all and everything from more modern compiler and rtl. Usually {$mode TP} is enough to compile.