home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug043.arc
/
SCREEN.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1979-12-31
|
2KB
|
74 lines
Program Screen;
{$C-}
Const
PrinterInit : String[6] = #27'2'#27'A'#8#15;
PrinterReset : String[2] = #27'@';
GrInit : String[4] = #27'K'#$80#$02;
Space = ' ';
Var
x,y,n : integer;
Resp : Char;
Char2 : Char;
Procedure WriteNulls;
Var i : Integer;
Begin
For i:=1 to 640 do Write(Lst,#$0);
End;
Begin
ClrScr;
Write ('Hit any key to start print, or <ESC> to abort');
REad(Kbd,Resp);
If REsp=#27 then Exit;
Writeln;
WriteNulls;
Writeln(Lst,PrinterReset,PrinterInit);
x:=0;
Write(Lst,' ');
Repeat
Write(Lst,' ');
x:=x+5;
if x=45 then Write(Lst,^H);
Write(Lst,x:2);
Until x>70;
Writeln(Lst);
For y:=1 to 24 do
For n:=0 to 1 do
Begin
If n=1 then Write(Lst,y:2) else Write(Lst,' ');
Write(Lst,GRInit);
For x:=1 to 80 do
Begin
If Round(20*x)/100=Round(0.2*x) then Char2:=Char($FF)
Else Char2:=Char(($01 and n));
If n=0 then Write(Lst,#$FF,Char2,#$00,#$00,#$00,#$00,#$00,#$00)
Else Write(Lst,#$FF,Char2,#$01,#$01,#$01,#$01,#$01,#$01);
If KeyPressed then
Begin
Write ('Abort print (Y/N)');
REpeat
Read(Kbd,Resp);
Resp:=UpCase(Resp);
Until Resp in ['Y','N'];
If Resp='Y' then
Begin
WriteNulls;
Writeln(Lst,PrinterReset);
Exit;
End;
Writeln;
End;
End;
Writeln(Lst);
End;
x:=0;
Write(Lst,' ');
Repeat
Write(Lst,' ');
x:=x+5;
if x=45 then Write(Lst,^H);
Write(Lst,x:2);
Until x>70;
Write(Lst,PrinterReset);
End.