Difference between revisions of "Crt"
(Created page with "Crt is a unit providing subroutines for programming in text mode. It is similar to ncurses C library. Procedures and functions: <TODO>") |
|||
Line 1: | Line 1: | ||
− | + | CRT is a unit providing subroutines for programming in text mode. It is similar to ncurses C library. | |
+ | It's intention is to be compatible with the Borland Pascal 7 CRT unit. | ||
− | |||
− | < | + | == Procedures and functions == |
+ | |||
+ | <nowiki>Keyboard: </nowiki><br> | ||
+ | <nowiki> Function KeyPressed: Boolean; </nowiki><br> | ||
+ | <nowiki> Function ReadKey: Char; </nowiki><br> | ||
+ | <nowiki> </nowiki><br> | ||
+ | <nowiki>Display: </nowiki><br> | ||
+ | <nowiki>Procedure TextMode (Mode: word); </nowiki><br> | ||
+ | <nowiki>Procedure Window(X1,Y1,X2,Y2: Byte); </nowiki><br> | ||
+ | <nowiki>Procedure Window32(X1,Y1,X2,Y2: DWord); </nowiki><br> | ||
+ | <nowiki>Procedure ClrScr; </nowiki><br> | ||
+ | <nowiki>Procedure ClrEol; </nowiki><br> | ||
+ | <nowiki>Procedure InsLine; </nowiki><br> | ||
+ | <nowiki>Procedure DelLine; </nowiki><br> | ||
+ | <nowiki>Procedure TextColor(Color: Byte); </nowiki><br> | ||
+ | <nowiki>Procedure TextBackground(Color: Byte); </nowiki><br> | ||
+ | <nowiki>Procedure LowVideo; </nowiki><br> | ||
+ | <nowiki>Procedure HighVideo; </nowiki><br> | ||
+ | <nowiki>Procedure NormVideo; </nowiki><br> | ||
+ | <nowiki> </nowiki><br> | ||
+ | <nowiki>Cursor Control: </nowiki><br> | ||
+ | <nowiki>Procedure cursoron; </nowiki><br> | ||
+ | <nowiki>Procedure cursoroff; </nowiki><br> | ||
+ | <nowiki>Procedure cursorbig; </nowiki><br> | ||
+ | <nowiki>Procedure GotoXY(X,Y: tcrtcoord); </nowiki><br> | ||
+ | <nowiki>Procedure GotoXY32(X,Y: DWord); </nowiki><br> | ||
+ | <nowiki> Function WhereX: tcrtcoord; </nowiki><br> | ||
+ | <nowiki> Function WhereY: tcrtcoord; </nowiki><br> | ||
+ | <nowiki> Function WhereX32: DWord; </nowiki><br> | ||
+ | <nowiki> Function WhereY32: DWord; </nowiki><br> | ||
+ | <nowiki> </nowiki><br> | ||
+ | <nowiki>Sound: </nowiki><br> | ||
+ | <nowiki>Procedure Sound(Hz: Word); </nowiki><br> | ||
+ | <nowiki>Procedure NoSound; </nowiki><br> | ||
+ | <nowiki> </nowiki><br> | ||
+ | <nowiki>Delay: (Typically used with sound) </nowiki><br> | ||
+ | <nowiki>Procedure Delay(MS: Word); </nowiki><br> | ||
+ | <nowiki> </nowiki><br> | ||
+ | <nowiki>File: </nowiki><br> | ||
+ | <nowiki>Procedure AssignCrt(var F: Text); </nowiki><br> | ||
+ | |||
+ | == Variables and Constants == | ||
+ | |||
+ | <nowiki>Color Constants:</nowiki><br> | ||
+ | <nowiki>Black = 0;</nowiki><br> | ||
+ | <nowiki>Blue = 1;</nowiki><br> | ||
+ | <nowiki>Green = 2;</nowiki><br> | ||
+ | <nowiki>Cyan = 3;</nowiki><br> | ||
+ | <nowiki>Red = 4;</nowiki><br> | ||
+ | <nowiki>Magenta = 5;</nowiki><br> | ||
+ | <nowiki>Brown = 6;</nowiki><br> | ||
+ | <nowiki>LightGray = 7;</nowiki><br> | ||
+ | <nowiki>DarkGray = 8;</nowiki><br> | ||
+ | <nowiki>LightBlue = 9;</nowiki><br> | ||
+ | <nowiki>LightGreen = 10;</nowiki><br> | ||
+ | <nowiki>LightCyan = 11;</nowiki><br> | ||
+ | <nowiki>LightRed = 12;</nowiki><br> | ||
+ | <nowiki>LightMagenta = 13;</nowiki><br> | ||
+ | <nowiki>Yellow = 14;</nowiki><br> | ||
+ | <nowiki>White = 15;</nowiki><br> | ||
+ | <nowiki>Blink = 128;</nowiki><br> |
Revision as of 16:25, 19 October 2017
CRT is a unit providing subroutines for programming in text mode. It is similar to ncurses C library. It's intention is to be compatible with the Borland Pascal 7 CRT unit.
Procedures and functions
Keyboard:
Function KeyPressed: Boolean;
Function ReadKey: Char;
Display:
Procedure TextMode (Mode: word);
Procedure Window(X1,Y1,X2,Y2: Byte);
Procedure Window32(X1,Y1,X2,Y2: DWord);
Procedure ClrScr;
Procedure ClrEol;
Procedure InsLine;
Procedure DelLine;
Procedure TextColor(Color: Byte);
Procedure TextBackground(Color: Byte);
Procedure LowVideo;
Procedure HighVideo;
Procedure NormVideo;
Cursor Control:
Procedure cursoron;
Procedure cursoroff;
Procedure cursorbig;
Procedure GotoXY(X,Y: tcrtcoord);
Procedure GotoXY32(X,Y: DWord);
Function WhereX: tcrtcoord;
Function WhereY: tcrtcoord;
Function WhereX32: DWord;
Function WhereY32: DWord;
Sound:
Procedure Sound(Hz: Word);
Procedure NoSound;
Delay: (Typically used with sound)
Procedure Delay(MS: Word);
File:
Procedure AssignCrt(var F: Text);
Variables and Constants
Color Constants:
Black = 0;
Blue = 1;
Green = 2;
Cyan = 3;
Red = 4;
Magenta = 5;
Brown = 6;
LightGray = 7;
DarkGray = 8;
LightBlue = 9;
LightGreen = 10;
LightCyan = 11;
LightRed = 12;
LightMagenta = 13;
Yellow = 14;
White = 15;
Blink = 128;