Reference for unit 'Crt'

CRT - Turbo Pascal screen and keyboard handling unit

Uses unit Description
System The system unit

Overview

This chapter describes the CRT unit for Free Pascal, under all of Dos, Linux and Windows. The unit was first written for Dos by Florian Klaempfl. The unit was ported to Linux by Mark May and enhanced by Michael Van Canneyt and Peter Vreman. It works on the Linux console, and in xterm and rxvt windows under X-Windows. The functionality for both is the same, except that under Linux the use of an early implementation (versions 0.9.1 and earlier of the compiler) the CRT unit automatically cleared the screen at program startup.

There are some caveats when using the CRT unit:

Programs using the CRT unit will not be usable when input/output is being redirected on the command-line. For similar reasons they are not usable as CGI-scripts for use with a webserver. The use of the CRT unit and the graph unit may not always be supported. The CRT unit is not thread safe. On Linux or other Unix OSes, executing other programs that expect special terminal behaviour (using one of the special functions in the Linux unit) will not work. The terminal is set in RAW mode, which will destroy most terminal emulation settings. The CRT unit stems from the TP/Dos area. It is designed to work with single-byte character sets, where 1 char = 1 byte. That means that widestrings or UTF-8 encoded (ansi)strings will not work correctly.