CRT Documentation: Reference |
Defines a text window on the screen.
procedure TextMode( Mode: integer );
When TextMode is called, the current window is reset to the entire screen, the current text attribute is reset to normal corresponding to a call to NormVideo, and the current video is stored in LastMode. In addition, LastMode is initialized at program startup to the then-active video mode.
Specifying TextMode(LastMode) causes the last active text mode to be re-selected.
If your system is in 43- or 50-line mode when you load a program, the mode will be preserved by the Crt startup code, and the window variable that keeps track of the maximum number of lines on the screen (WindMax) will be initialized correctly.
Here's how to write a "well-behaved" program that will restore the video mode to its original state:
{$APPTYPE CONSOLE} program Video; uses Crt; var OrigMode: Word; begin OrigMode := LastMode; { Remember original mode } ... TextMode(OrigMode); end.