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
NoBorder
SingleBorder
DoubleBorder
DTopSSide
STopDSide
DTopSSideHang 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

Function HtReadKey(VAR Funckey:BOOLEAN):CHAR
Function EosCol:BYTE
Function EosRow:BYTE
Function HtReadAttr(Row,Col:BYTE):BYTE
Function HtReadChar(Row,Col:BYTE):CHAR
Function ShadowAttr(Attr:BYTE):BYTE
Function InputString(VAR S:ShortSTRING;R,C,L,ML:BYTE;Attr:INTEGER;KeySet:KeySetType):KeyType
Function InputBool(VAR B:BOOLEAN;R,C:BYTE;Attr:INTEGER;KeySet:KeySetType):KeyType
Function InputYNAsk(VAR B:Byte;R,C:BYTE;Attr:INTEGER;KeySet:KeySetType):KeyType
Function InputList(Ws:String;VAR B:Byte;R,C:BYTE;Attr:INTEGER;KeySet:KeySetType):KeyType

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)

Procedure HtDelay(MS:Double)
Procedure GoToRC(Row,Col:BYTE)
Procedure EosToRC(Row,Col:BYTE)
Procedure GoToEos
Procedure GetCursor(VAR Cursor:WORD)
Procedure SetCursor(Cursor:WORD)
Procedure HtWrite(Row,Col:BYTE;Attr:INTEGER;S:STRING)
Procedure HtWriteC(Row,Col:BYTE;Attr:INTEGER;S:STRING)
Procedure HtAttr(Row,Col,Rows,Cols,Attr:BYTE)
Procedure HtFill(Row,Col,Rows,Cols,Attr:BYTE;C:CHAR)
Procedure HtScrollUp(Row,Col,Rows,Cols,BlankAttr:BYTE)
Procedure HtScrollDown(Row,Col,Rows,Cols,BlankAttr:BYTE)
Procedure HtClrScr(Attr:Byte;Ch:Char)
Procedure AddShadow(Row,Col,Rows,Cols:BYTE)
Procedure Box(Row,Col,Rows,Cols,Attr,Border:BYTE;Fill:CHAR)
Procedure ExplodeBox(Row,Col,Rows,Cols,Attr,Border:BYTE)
Procedure InKey(VAR Ch:CHAR;VAR Fk:BOOLEAN;VAR Key:KeyType)
Procedure InKeyEx(VAR Ch:CHAR;VAR Fk:BOOLEAN;VAR Key:KeyType;Clock:Boolean;ClockAttr:Byte)