Unit CRT2; Interface Uses Crt; Procedure InputFileNev(s: String); Procedure OutputFileNev(s: String); Procedure KonzolInput; Procedure KonzolOutput; Procedure BillreVar; Implementation Var IFilenev, OFilenev : String; Procedure uzenet(s :string); Const ablakszel=70; Type Tkep=array[1..80,1..25] of record mi,attrib:byte end; Var kep:Tkep absolute $B800:$0000; ment:Tkep; Procedure Uzenetinic; begin ment:=kep; window(3,3,ablakszel,5); Textbackground(red);Textcolor(white);clrscr; end; Procedure Vissza; Begin NormVideo; window(1,1,80,25); kep:=ment; End; begin uzenetinic; writeln(s:Trunc((ablakszel+length(s))/2)); writeln; write('šss”n le egy billentyût!':Trunc((ablakszel+26)/2)); BillreVar; Vissza; end; Procedure InputFileNev(s: String); Begin IFileNev:=s; Assign(Input,s); {$I-} Reset(Input); If IoResult<>0 then Begin uzenet('Nem tal lom az input file-t, konzolr¢l olvasom az adatokat...'); KonzolInput; End; {$I+} End; Procedure OutputFileNev(s: String); Begin OFileNev:=s; Assign(Output,s); Rewrite(Output); End; Procedure KonzolInput; Begin {Close(fInput);} Assign(Input,'CON'); Reset(Input); End; Procedure KonzolOutput; Begin {Close(fOutput);} Assign(Output,'CON'); Rewrite(Output); End; Procedure BillreVar; Var c: Char; Begin Repeat Until not KeyPressed; c:=ReadKey; End; Begin clrscr; if paramcount=0 then begin konzolinput; konzoloutput; end else begin inputfilenev(paramstr(1)); if paramcount=1 then konzoloutput else outputfilenev(paramstr(2)); end; End. {--------------------------------------------------------------}