First simply command
ClrScr
Command clears a screeen and set actual color.
GotoXY(X,Y:byte)
Get a cursor to a position definited by X,Y. Resolution has a resolution of 25 linrs and 80 columns.
Write (S:[premenná var])
Write('text between apostrophes');
It will write on actual position of cursor a ammount of variable or tetxt between an apostrophes.
WriteLn(S:[variable var]);
WriteLn('text between apostrophes');
Like write, but it wile write it to the new line.
Read (S:[variable var])
Read a entry from a keyboard, and save it to the S variable.
ReadLn (S:[variable var]);
Like read, but it will read a character for the end of the line. (Enter). For saving a variables always use a ReadLn no Read.
{ Example: Program ask for numbers X,Y and name } { after this at axis X,Y write name } program read_write; uses crt,dos; var x,y:integer; name:string; begin Clrscr; GotoXY(2,2);WriteLn('Insert axis X='); ReadLn(X); GotoXY(2,3);WriteLn('Insert axis Y='); ReadLn(Y); GotoXY(3,3);WriteLn('Insert name'); ReadLn(name); GotoXY(X,Y);WriteLn(name); end.
TextColor(Col:byte)
Set color of chars which write at monitor.
Number | Color | Color | Number | Color | Color |
---|---|---|---|---|---|
0 | Black | Black | 8 | Darkgray | Darkgray |
1 | Blue | Blue | 9 | Lightblue | Lightblue |
2 | Green | Green | 10 | Lightgreen | Lightgreen |
3 | Cyan | Cyan | 11 | Lightcyan | Lightcyan |
4 | Red | Red | 12 | Lightred | Lightred |
5 | Magenta | Magenta | 13 | Lightmagenta | Lightmagenta |
6 | Brown | Brown | 14 | Yellow | Yellow |
7 | Lightgray | Lightgray | 15 | White | White |
TextBackground(Col:byte)
Set color of background for chars writable at monitor. Limitation is only for colors 0-7.
Where to go: Content | Non-conditioned cycle FOR