Unit Crt


The unit Crt exports functions and procedures for easy character based I/O. The unit exports functions to manipulate the textcolor, the cursor position etc.

Using this unit increases the speed of output, because the unit redirects the output and writes direct to the screen.


assigncrt

procedure assigncrt(var f : text);



check*

var
   checkbreak : boolean;
   checkeof : boolean;
   checksnow : boolean;

These variables are for compatibility with TP and aren't used by the FPKPascal CRT unit.


clrscr

procedure clrscr;

Clears the current window with the background color.

See also: textbackground, window


clreol

procedure clreol;


cursorbig

procedure cursorbig;

Sets the cursor shape to full character height.

See also: cursoroff, cursoron


cursoroff

procedure cursoroff;

Turns the cursor off.

See also: cursorbig, cursoron


cursoron

procedure cursoron;

Turns the cursor on.

See also: cursorbig, cursoroff


delay

procedure delay(ms : longint);

Delays the execution of the program ms*1/1000 secs.


delline

procedure delline;
procedure delline(line : byte);



directvideo

directvideo : boolean;

If this variable is true, the cursor is set via direct port access, else using the BIOS. The default value is true and should never make problems.

NOTE: The directvideo of Turbo Pascal works in another way.


gotoxy

procedure gotoxy(x,y : byte);

Sets the cursor position to x,y. The upper left corner is (1,1).

See also: where*


highvideo

procedure highvideo;




insline

procedure insline;


keypressed

function keypressed : boolean;

lastmode

lastmode : word; 


lowvideo

procedure lowvideo;

normvideo

procedure normvideo;


nosound

procedure nosound;


readkey

function readkey : char;

screen modes

const
   bw40 = 0; 
   co40 = 1;
   bw80 = 2;
   co80 = 3;
   mono = 7;
   font8x8 = 256;

sound

procedure sound(hz : word);

textattr

textattr : byte; { current text attribute } 

textbackground

procedure textbackground(color : byte);

text colors

{ screen color, fore- and background } 
const
   black = 0;
   blue = 1; 
   green = 2;
   cyan = 3;
   red = 4;
   magenta = 5;
   brown = 6;
   lightgray = 7;
  { only foreground }
  darkgray = 8;
  lightblue = 9; 
  lightgreen = 10; 
  lightcyan = 11; 
  lightred = 12; 
  lightmagenta = 13; 
  yellow = 14; 
  white = 15;
  { blink flag } 
  blink = $80;

See also: textcolor, textbackground


textcolor

procedure textcolor(color : byte);

Sets the color for the text output.


textmode

procedure textmode(mode : integer);


where*

function wherex : byte;
function wherey : byte;

Returns the position of the cursor. The upper left corner is 0,0.

NOTE: If you want to set a position with gotoxy, the upper left corner is (1,1).

...
gotoxy(wherex+1,wherey+1);    { the cursor don't stays at the current position }
...

See also: gotoxy


windm*

windmax : word; { lower right corner of the CRT window }
windmin : word; { upper left corner of the CRT window }

This variables contains the upper left and the lower right corner of the output window used by the CRT unit. These variables shouldn't be modified direct, use window for this purpose.

See also: window


window

procedure window(left,top,right,bottom : byte);


klaempfl@haegar.cip.mw.uni-muenchen.de

Copyright (c) 1997 by Florian Klaempfl