Crt: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 2 | - | ||
| 3 | - | ||
| 4 | - | ||
| 5 | - | ||
| 6 | - | ||
| 7 | - | ||
| 8 | - | ||
| 9 | - | ||
| 10 | - | ||
| 11 | - | ||
| 12 | - | ||
| 13 | - | ||
| 14 | - | ||
| 15 | - | ||
| 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 / Turbo Pascal 7 CRT unit. | |
| 16 | 2 | ||
| 17 | 3 | ## Procedures and Functions | |
| 18 | 4 | ||
| 19 | 5 | ### Keyboard: | |
| 20 | - | ||
| 6 | + | ||
| 7 | + | ``` pascal | |
| 21 | 8 | Function KeyPressed: Boolean; | |
| 22 | - | ||
| 9 | + | Function ReadKey: Char; | |
| 23 | 10 | ``` | |
| 24 | 11 | ||
| 25 | 12 | ### Display: | |
| 26 | - | ||
| 13 | + | ||
| 14 | + | ``` pascal | |
| 27 | 15 | Procedure TextMode (Mode: word); | |
| 28 | - | ||
| 29 | - | ||
| 30 | - | ||
| 31 | - | ||
| 32 | - | ||
| 33 | - | ||
| 34 | - | ||
| 35 | - | ||
| 36 | - | ||
| 37 | - | ||
| 38 | - | ||
| 16 | + | Procedure Window(X1,Y1,X2,Y2: Byte); | |
| 17 | + | Procedure Window32(X1,Y1,X2,Y2: DWord); | |
| 18 | + | Procedure ClrScr; | |
| 19 | + | Procedure ClrEol; | |
| 20 | + | Procedure InsLine; | |
| 21 | + | Procedure DelLine; | |
| 22 | + | Procedure TextColor(Color: Byte); | |
| 23 | + | Procedure TextBackground(Color: Byte); | |
| 24 | + | Procedure LowVideo; | |
| 25 | + | Procedure HighVideo; | |
| 26 | + | Procedure NormVideo; | |
| 39 | 27 | ``` | |
| 40 | 28 | ||
| 41 | 29 | ### Cursor Control: | |
| 42 | - | ||
| 30 | + | ||
| 31 | + | ``` pascal | |
| 43 | 32 | Procedure cursoron; | |
| 44 | - | ||
| 45 | - | ||
| 46 | - | ||
| 47 | - | ||
| 48 | - | ||
| 49 | - | ||
| 50 | - | ||
| 51 | - | ||
| 33 | + | Procedure cursoroff; | |
| 34 | + | Procedure cursorbig; | |
| 35 | + | Procedure GotoXY(X,Y: tcrtcoord); | |
| 36 | + | Procedure GotoXY32(X,Y: DWord); | |
| 37 | + | Function WhereX: tcrtcoord; | |
| 38 | + | Function WhereY: tcrtcoord; | |
| 39 | + | Function WhereX32: DWord; | |
| 40 | + | Function WhereY32: DWord; | |
| 52 | 41 | ``` | |
| 53 | 42 | ||
| 54 | 43 | ### Sound: | |
| 55 | - | ||
| 44 | + | ||
| 45 | + | ``` pascal | |
| 56 | 46 | Procedure Sound(Hz: Word); | |
| 57 | - | ||
| 47 | + | Procedure NoSound; | |
| 58 | 48 | ``` | |
| 59 | 49 | ||
| 60 | 50 | ### Delay: (Typically used with sound) | |
| 61 | - | ||
| 62 | - | ||
| 63 | - | ||
| 64 | 51 | ||
| 65 | - | ||
| 52 | + | ``` pascal | |
| 53 | + | Procedure Delay(MS: Word); | |
| 66 | 54 | ``` | |
| 67 | - | ||
| 55 | + | ||
| 56 | + | ===<File:===> | |
| 57 | + | ||
| 58 | + | ``` pascal | |
| 59 | + | Procedure AssignCrt(var F: Text); | |
| 68 | 60 | ``` | |
| 69 | 61 | ||
| 70 | 62 | ## Variables and Constants | |
| 71 | 63 | ||
| 72 | 64 | ### Color Constants: | |
| 73 | - | ||
| 65 | + | ||
| 66 | + | ``` pascal | |
| 74 | 67 | const | |
| 75 | - | ||
| 76 | - | ||
| 77 | - | ||
| 78 | - | ||
| 79 | - | ||
| 80 | - | ||
| 81 | - | ||
| 82 | - | ||
| 83 | - | ||
| 84 | - | ||
| 85 | - | ||
| 86 | - | ||
| 87 | - | ||
| 88 | - | ||
| 89 | - | ||
| 90 | - | ||
| 91 | - | ||
| 68 | + | Black = 0; | |
| 69 | + | Blue = 1; | |
| 70 | + | Green = 2; | |
| 71 | + | Cyan = 3; | |
| 72 | + | Red = 4; | |
| 73 | + | Magenta = 5; | |
| 74 | + | Brown = 6; | |
| 75 | + | LightGray = 7; | |
| 76 | + | DarkGray = 8; | |
| 77 | + | LightBlue = 9; | |
| 78 | + | LightGreen = 10; | |
| 79 | + | LightCyan = 11; | |
| 80 | + | LightRed = 12; | |
| 81 | + | LightMagenta = 13; | |
| 82 | + | Yellow = 14; | |
| 83 | + | White = 15; | |
| 84 | + | Blink = 128; | |
| 92 | 85 | ``` | |
| 93 | 86 | ||
| 94 | 87 | --- | |
| 95 | - | ||
| 88 | + | *From the Free Pascal wiki, page "Crt", as it stood on 2019-12-27 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* | |
| 89 | + | Category: Units |
