Window (X1, Y1, X2, Y2: Byte) :
(1, 1) | ||||
(X1, Y1) | ||||
(X2, Y2) | ||||
(Xmax, Ymax) |
X1, Y1, X2, Y2 :
1<=X1 <X2<=Xmax; 1<=Y1<Y2<=Ymax;
Xmax 40 80 ( MDA/Ytrcules 80), Ymax : 25 ( ) 43 50 (EGA VGA ).
Window , X1, Y1, X2, Y2. , (1, 1) . .
, .
WindMax: Word WindMin: Word . Y . Y Lo Hi:
X1:=Lo(WindMin)+1; X2:=Lo(WindMax)+1;
Y1:=Lo(WindMin)+1; Y2:=Lo(WindMax)+1;
X1, Y1, X2, Y2 .
. , (1, 1). WindMax WindMin ( (0, 0)).
ClrScr . .
.
TextBackGround(Blue);
ClrScr; { }
, ClrScr (1, 1) .
ClrEOL , . . , . , . .
TextMode (M:Word) . Crt .
= | ||
BW40 = 0 | 40 25 | - |
CO40 = 1 C40 = 1 | 40 25 | |
BW80 = 2 | 80 25 | - |
CO80 = 3 C80 = 3 | 80 25 | |
Mono = 7 | 80 25 | MDA/Hercules |
Font88 = 256 | 80/40 43 | EGA |
80/40 50 | VGA | |
65 535, (0, 1, 2, 3, 7), Font88 TextMode 80. |
|
|
.
.
TextMode(CO80); TextMode(3);
.
TextMode LastMode.
Font8x8. 88 EGA VGA, 814 816 88, 43 (EGA) 50 (VGA). , .. .
.
TextMode(CO80+Font8 x 8);
TextMode . , :
Windows (1, 1, Xmax, Ymax); { }
DirectVideo ß True; { }
CheckSnow ß False; { (CGA)}
NormVideo; { }
ClrScr; { }
LastMode ß ; { TextMode }
LastMode. , TextMode. ( Word) TextMode. LastMode , .
LastMode , :
.
Uses Crt;
Var StartMode: Word;
Begin
StartMode: =LastMode; { }
{ }
TextMode (StartMode) { }
End.
GoToXY (X, Y: Byte) Y . GoToXY , .. (1, 1) .
.
GoToXY :
Program Demo_GoToXY;
Uses Crt;
Procedure VertStr(X, Y:Byte; S:String);
Var Len: Byte Absolute S; { S}
I: Byte;
Begin
For I:=1 To Len Do { : For I:=1 To Length(s) Do }
Begin
GoToXY(x, y+Pred(i)); { }
Write(S[i]) { }
End;
End;
Begin
ClrScr;
VertStr(40,7,!);
Readln
End.
WhereX WhereY . , WhereX, WhereY. GoToXY.
|
|
InsLine DelLine . .
.
, :
Program Demo_InsLine;
Uses Crt;
Var I: Byte;
Begin
ClrScr;
For I:=1 To 25 Do
Begin
GoToXY(1,1); InsLine { }
Write(' N', i);
Delay(200);
End;
Readln
End.
DelLine , , . .
TextColor (C: Byte) TextBackGround (C: Byte) TextAttr ( ). , .
HigeVideo LowVideo (1) (0). LowVideo , HigeVideo .
NormVideo ( , ), .
HigeVideo, LowVideo, NormVideo TextColor, .
, . .
Sound(Hz:Word) , , NoSound. Sound, NoSound Delay(ms:Word), .
. 300 1 .
Sound(300);
Delay(1000);
NoSound;
.
. , Dos , -. - , , , , . Dos, -, . - . , - , Shift CapsLock ASCII .
: , . 15 .
KeyPressed, , True, - . , .
ReadKey Char , . , .
KeyPressed - , , Repeat While.
1.
Uses Crt;
Begin
Repeat
Write ( );
Until KeyPressed
End.
Uses Crt;
Begin
While Not KeyPressed Do
Write ( )
End.
, . .
|
|
.
If KeyPressed Then Key:=ReadKey;
Key - . , .
: Crt Dos (. ). . (. )
. | . | ||||||||||||||||||||||
1 |
| 8 |
| ||||||||||||||||||||
2 |
| 9 |
| ||||||||||||||||||||
3 |
| 10 |
| ||||||||||||||||||||
4 |
| 11 |
| ||||||||||||||||||||
5 |
| 12 |
| ||||||||||||||||||||
6 |
| 13 |
| ||||||||||||||||||||
7 |
| 14 |
|
:
1, 6, 9, 13 - , 2, 4
1, 6, 14 .
:
1. Crt.
2. Crt.
3. Crt.
4. , Dos.
5. Dos.
, , , Crt Dos.