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