Program ChrView;
{$G+,N+,E-,D-}
Uses Graph, CRT, F_GrText;
{C:\wow.txt}
{$L C:\PROGRA~2\BP70\BIN\EGAVGA.OBJ}
Procedure EGAVGA; External;
{$L C:\PROGRA~2\BP70\EXEC\ALPH.OBJ}
Procedure ALPH; External;
var
P : Pointer;
D, R, e : Integer;
Font : Integer;
f : Text;
i : Integer;
S : String;
begin
if ParamCount = 0 then Halt($FFFF);
P := @EGAVGA;
D := Detect;
if RegisterBGIdriver(P) < 0 then
begin
Writeln('Ошибка регистрации драйвера: ',
GraphErrorMsg(GraphResult));
Halt(1);
end;
InitGraph(D, R, '');
e := GraphResult;
if e <> grOk then
begin
WriteLn('Произошла ошибка графики!!!');
WriteLn(GraphErrorMsg(e));
end;
Assign(f, ParamStr(1));
Reset(f);
P := @ALPH;
Font := RegisterCHRFont(P);
MoveTo(1, 20);
While not EOF(f) do
begin
ReadLn(f, S);
MoveTo(1, GetY+20);
for i := 1 to Length(S) do
begin
OutString(S[i], Font, 0, 0.8, 0.8);
if GetX + 20>640 then
begin
if S[i]<>' ' then
begin
MoveTo(GetX+4, GetY-5);
LineTo(GetX+5, GetY);
end;
MoveTo(1, GetY+25);
end;
end;
if GetY + 50 > 480 then
begin
if ReadKey = #27 then Break;
ClearDevice;
end;
end;
ReadKey;
Close(f);
CloseGraph;
end.