Turbo Vision (, ..). , , CRT, .
- - : , (- ) ( ), , . , (, ). , , , , .
(1981 .), IBM PC, (MDA). : - 25 40 80 . ( ), , 40x25 . MDA - .
1982 Hercules HGC ( . Hercules Graphics Card - ), MDA , 720x350 ().
IBM CGA (Color Graphics Adapter) . CGA , ( 320x200 640x200 ). 40x25 80x25 , . , MDA, ,
( ). 16 8 - .
CGA - IBM - EGA, MCGA, VGA SVGA. CRT .
TextMode.
. :
Procedure TextMode(Mode: Word);
Mode - . , CRT:
const
BW40=0{- 40x25}
40=1{ 40x25}
BW80=2{- 80x25}
80=3{ 80x25}
Mono=7{ MDA}
Font8x8=256{ 8043
8050 EGA VGA}
, TextMode, LastMode CRT .
. , TextMode , .
Uses CRT;
Procedure Print(S: String);
( S }
begin
WriteLn(S); { }
WriteLn(' Enter...');
ReadLn { Enter}
end; {Print}
var
LM: Word;{ }
begin
LM := LastMode; { }
TextMode(40);
Print(' 40x25");
TextMode(CoSO) ;
Print(' 80x25');
TextMode(Co40+Font8x8);
Print(' Co40+Font8x8') ;
TextMode(Co80+Font8x8);
Print(' Co80+Font8x8');
{ :}
TextMode(LM)
end.
TextColpr.
. :
Procedure TextColor(Color: Byte);
TextBackground.
. :
Procedure TextBackground(Color: Byte);
Byte, . , CRT:
const
Black = 0;{}
Blue = 1;{-}
Green = 2 ;{-}
Cyan = 3;{}
Red = 4 ;{}
Magenta = 5;{}
Brown = 6 ;{}
LightGray = 7;{-}
DarkGray = 8;{-}
LightBlue = 9;{}
LightGreen = 10;{-}
LightCyan = 11;{-}
LightRed = 12;{}
LightMagenta = 13;{}
Yellow = 14;{}
White ' =15;{}
Blink =128;{ }
.
Uses CRT;
const
Col: array [1..15] of String [16] =
('-','-','','',
'','','-','-',
'','','-','',
'','','');
var
k: Byte;
begin
for k := 1 to 15 do
begin { 15 }
TextColor(k);
WriteLn(' ', k, ' - ',Col[k])
end;
TextColor(White+Blink); { }
WriteLn(' ');
{ }
TextColor(LightGray);
WriteLn
end.
WriteLn: , , ,
TextColor(LightGray)
, TextAttr CRT Write/WriteLn.
ClrScr.
(. Window). () . :
Uses CRT;
var
: Char
begin
TextBackground(red) ;
ClrScr;{ }
WriteLn(' ...');
:= ReadKey; { }
TextBackground(Black) ;
ClrScr { }
end.
Window.
- , . , ( ). , , , , , .. . :
Procedure Window(XI,Y1,X2,Y2: Byte);
X1...Y2 - (XI,Y1) (X2,Y2) . , (1,1), , - .
.
Uses CRT;
var
k: integer;
begin
{ - :}
TextBackground(Blue);
Window(5,2,35,17);
TextColor(Yellow);
for k := 1 to 100 do
Write(' Enter...');
ReadLn; { Enter}
ClrScr; { }
{ - :}
TextBackground(Red);
TextColor(White);
Window(40,2,70,17);
for k := 1 to 100 do
Write(' Enter...');
ReadLn;
TextMode(C080) { }
end.
Window , - : 2>1 Y2>Y1. Window . CRT: WindMin Word X1 Y1 (XI - ), WindMax - 2 Y2(X2 - ). Window. ,
Window(40,2,70,17);
WindMin := 39+(1 shl 8);
WindMax := 69+(16 shl 8);
( Window , WindMin WindMax, 0,0).
GotoXY.
. :
Procedure GotoXY(X,Y: Byte);
X, Y - . (), .
GotoXY(1,1);
( , ). , ().
whereX WhereY.
Byte : WhereX , a WhereY - .
, , .
Uses CRT;
const
LU =#218;{ }
RU =#191;{ )}
LD =#192;{ }
RD =#217;{ }
H =#196;{ }
V =#179;{ }
X1 =14;{ }
Y1 =5;
X2 =66;
Y2 =20;
Txt = ' Enter...';
var
k: integer;
begin
ClrScr; { }
{ - :}
TextBackground(Blue);
TextColor(Yellow);
Window(X1,Y1,X2,2);
ClrScr;
{ }
Write(LU); { }
{ }
for k: = X1+1 to X2-1 do Write(H);
Write(RU);{ }
for k := Y1+1 to Y2-1 do{ }
begin
GotoXY(1,k-Y1+1);{ }
Write(V);{ }
GotoXY(X2-X1+1,WhereY){ }
Write(V){ }
end;
Write(LD);
{ }
Window(X1,Y1,X2,Y2+1);{ , }
GotoXY(2,Y2-Y1+1); { }
{ }
for k:= X1+1 to X2-1 do Write(H);
Write(RD); { }
{ }
Window(X1+1,Y1+1,X2-1,Y2-1);
{ }
for k := Y1+1 to Y2-2 do
WriteLn(' , ',k-Y1);;
{ }
Write(' ...');
k := ord(ReadKey); if k=0 then
k := ord(ReadKey);
DelLine; { }
{ }
for k := Y1+1 to Y2-2 do
begin
GotoXY((X2-X1) div 2,k-Y1);
Write(' , ',k-Y1)
end ;
{ Enter}
GotoXY((X2-X1-Length(Txt)) div 2,Y2-Y1-1);
TextColor(White);
Write(Txt);
ReadLn;
{ }
TextMode(CO80)
end.
.
ClrEOL.
(). .
DelLine.
( , ). ( ) .
InsLine.
: ; , (), ; .
LowVideo, NormVideo HighVideo.
, . :
Uses CRT;
begin
LowVideo;
WriteLn(' ');
NormVideo;
WriteLn(' ');
HighVideo;
WriteLn(' ')
end.
, .
AssignCRT.
F (.. , ). ( 3...5 ) , Assign. :
Procedure AssignCRT(F: Text);
. F Assign CON (.. ) N1 5*55 = 275 . AssignCRT N2 . N1 N2 .
, [$0040:$006] 55 .
Uses CRT;
var
F: Text;
t: LongInt;{ }
N1,N2: Word;{ }
const
txt = ' Text';
begin
{----- -----}
Assign(F,'CON');
Rewrite(F);
N1 := 0;{ }
ClrScr;{ }
{ :}
t := MemL[$0040:$006C];
{ 55- , :}
while MemL[$0040:$006C]=t do;
{ 5 }
while MemL[$0040:$006]