Built-in Units

DISPLAY

Since early Pascal days, most of the video and keyboard oriented functionality has been grouped into a display oriented unit. In the old DOS days, it was called CRT, now, we call it DISPLAY. Modern Pascal's display unit is aware of the environment in which it is operating, so it understands how to change color in a DOS window, Linux shell, X11 terminal, even a remote SSH session. You simply call TextColor(Yellow); and Modern Pascal does the correct command.

Globals

Black
Blue
Navy
Green
Cyan
Teal
Maroon
Magenta
Brown
Silver
LightGray
DarkGray
LightBlue
Lime
LightCyan
LightRed
LightMagenta
Yellow
White
Blink
NUL
SOH
STX
ETX
BRK
EOT
ENQ
ACK
BEL
BS
TAB
LF
VT
FF
CR
SO
SI
DLE
DC1
DC2
DC3
DC4
NAK
SYN
ETB
CAN
EM
SUB
EOF
ESC
FS
GS
RS
US
Ctrl_A
Ctrl_B
Ctrl_C
Ctrl_D
Ctrl_E
Ctrl_F
Ctrl_G
Ctrl_H
Ctrl_I
Ctrl_J
Ctrl_K
Ctrl_L
Ctrl_M
Ctrl_N
Ctrl_O
Ctrl_P
Ctrl_Q
Ctrl_R
Ctrl_S
Ctrl_T
Ctrl_U
Ctrl_V
Ctrl_W
Ctrl_X
Ctrl_Y
Ctrl_Z
Key_Home
Key_Up
Key_PgUp
Key_Left
Key_Right
Key_End
Key_Down
Key_PgDn
Key_F1
Key_F2
Key_F3
Key_F4
Key_F5
Key_F6
Key_F7
Key_F8
Key_F9
Key_F10
Key_F11
Key_F12
Key_Alt_F1
Key_Alt_F2
Key_Alt_F3
Key_Alt_F4
Key_Alt_F5
Key_Alt_F6
Key_Alt_F7
Key_Alt_F8
Key_Alt_F9
Key_Alt_F10
Key_Alt_F11
Key_Alt_F12
Key_Alt_A
Key_Alt_B
Key_Alt_C
Key_Alt_D
Key_Alt_E
Key_Alt_F
Key_Alt_G
Key_Alt_H
Key_Alt_I
Key_Alt_J
Key_Alt_K
Key_Alt_L
Key_Alt_M
Key_Alt_N
Key_Alt_O
Key_Alt_P
Key_Alt_Q
Key_Alt_R
Key_Alt_S
Key_Alt_T
Key_Alt_U
Key_Alt_V
Key_Alt_W
Key_Alt_X
Key_Alt_Y
Key_Alt_Z
Key_Shift_Alt_A
Key_Shift_Alt_B
Key_Shift_Alt_C
Key_Shift_Alt_D
Key_Shift_Alt_E
Key_Shift_Alt_F
Key_Shift_Alt_G
Key_Shift_Alt_H
Key_Shift_Alt_I
Key_Shift_Alt_J
Key_Shift_Alt_K
Key_Shift_Alt_L
Key_Shift_Alt_M
Key_Shift_Alt_N
Key_Shift_Alt_O
Key_Shift_Alt_P
Key_Shift_Alt_Q
Key_Shift_Alt_R
Key_Shift_Alt_S
Key_Shift_Alt_T
Key_Shift_Alt_U
Key_Shift_Alt_V
Key_Shift_Alt_W
Key_Shift_Alt_X
Key_Shift_Alt_Y
Key_Shift_Alt_Z
TextAttr
WindMaxX
WindMaxY
WindMax
WindMinX
WindMinY
WindMin

Functions

Function KeyPressed:Boolean
Function ReadKey:AnsiChar
Function WhereX:Byte
Function WhereY:Byte
Function ScreenWidth:Byte
Function ScreenHeight:Byte
Function Ask(Q,M:String;AllowBlank:Boolean;Timeout:Word):String
Function AskUTF8(Q,M:String;AllowBlank:Boolean;Timeout:Word):String

Procedures

Procedure CursorOn()
Procedure CursorOff()
Procedure ClrScr()
Procedure ClrEol()
Procedure Delay(ms:Word)
Procedure DelLine()
Procedure GotoXy(X,Y:Word)
Procedure GotoXY(XY:Word)
Procedure InsLine()
Procedure NoSound()
Procedure Sound(Hz:Word)
Procedure TextBackground(BG:Byte)
Procedure TextColor(FG:Byte)
Procedure Window(X1,Y1,X2,Y2:Byte)
Procedure Color(Const FG,BG:Byte)
Procedure PipeWrite(S:String)
Procedure PipeWriteUTF8(S:String)
Procedure WriteXY(X,Y:Byte;S:String)
Procedure WriteXY(X,Y:Byte;I:Longword)
Procedure Prompt(Msg:String;Timeout:Word)