Alexey Kotlyarov wrote:
Now I understand more about the problem. If I put the CRT unit in, each write will actually be to some virtual screen appearing on top of my console and disappearing after program finished.
Though technically not 100% correct, that's a way to imagine it. BTW, if you use the X11 version of PDCurses (install PDCurses and compile with "-DX11"), it will open its own X11 window and do all CRT I/O there. In this case, it's quite obvious that all output will disappear when the program finishes.
What to do about it depends on what you really want to achieve (which I can't tell from the small example, of course). If you want to keep the last screen from CRT after terminating the program, that's not directly possible with CRT (and even if it were, it wouldn't be recommended, since X11 terminals are switched to an "alternate mode" for CRT, and continuing in this mode for regular I/O afterward has some strange effects).
What I wanted to achieve was just compiling old BP things which use CRT for almost no reason (such as "clrscr" in the start or "delay" somewhere). However, with all this, I will just remove the uses directive. Thanks for the clarifications!
Yes, that's what I'd suggest. Instead of "Delay" use can use "Sleep" (seconds) or "SleepMicroSeconds" (microseconds). You need "uses GPC" for both.
Yang Lao wrote:
There's a lot of historical-baggage connected with the crt unit, especially the notorious Runtime error 200 issue.
Only in the BP version. I didn't actually emulate this bug in GPC. ;-)
Frank