Difference between revisions of "Crt"
From Lazarus wiki
Jump to navigationJump to search (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>") |
m (Fixed template loop) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{LanguageBar}} | |
− | + | 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 / Turbo Pascal 7 CRT unit. | ||
− | < | + | |
+ | == Procedures and Functions == | ||
+ | |||
+ | ===Keyboard:=== | ||
+ | <syntaxhighlight lang="pascal"> | ||
+ | Function KeyPressed: Boolean; | ||
+ | Function ReadKey: Char; | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===Display:=== | ||
+ | <syntaxhighlight lang="pascal"> | ||
+ | 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; | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===Cursor Control:=== | ||
+ | <syntaxhighlight lang="pascal"> | ||
+ | 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; | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===Sound:=== | ||
+ | <syntaxhighlight lang="pascal"> | ||
+ | Procedure Sound(Hz: Word); | ||
+ | Procedure NoSound; | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===Delay: (Typically used with sound)=== | ||
+ | <syntaxhighlight lang="pascal"> | ||
+ | Procedure Delay(MS: Word); | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===File:=== | ||
+ | <syntaxhighlight lang="pascal"> | ||
+ | Procedure AssignCrt(var F: Text); | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | == Variables and Constants == | ||
+ | |||
+ | ===Color Constants:=== | ||
+ | <syntaxhighlight lang="pascal"> | ||
+ | const | ||
+ | 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; | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | [[Category:Units]] |
Latest revision as of 07:09, 27 December 2019
│ Deutsch (de) │ English (en) │
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 / Turbo 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:
const
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;