{$T-}
program UCONV;
{program to convert lower case ASCII
 letters to upper case.
 
 V1A - Bill Heidebrecht - 9 Aug 1977}
 
const NL = CHR(10);
 
var INFILE, OUTFILE: TEXT;
 
procedure INITFILES;
var FILENAME: array [1..32] of CHAR;
 
  procedure GETFILENAME;
  var I: INTEGER;
      CH: CHAR;
  begin
    I:= 0;
    BREAK(OUT);
    repeat
      READ(INP,CH);
      I:= I+1; FILENAME[I]:= CH
    until CH = NL;
    FILENAME[I]:= ' ';
  end;
 
begin {INITFILES}
  WRITE(OUT,NL,'IN FILE: ');
  GETFILENAME;
  RESET(INFILE, FILENAME);
  WRITE(OUT,NL,'OUTFILE: ');
  GETFILENAME;
  REWRITE(OUTFILE, FILENAME);
  WRITE(OUT,NL); BREAK(OUT);
end;
 
procedure CONVERT;
var I, N: INTEGER;
    CH: CHAR;
const SMALLA = ORD('a');
      SMALLZ = ORD('z');
begin
  N:= 0;
  WRITE(OUTFILE,NL);
  while ~EOF(INFILE) do
  begin
    READ(INFILE,CH); I:= ORD(CH);
    if (I>=SMALLA) & (I<=SMALLZ) then
      CH:= CHR(I-32);
    if CH = NL then N:= N+1;
    WRITE(OUTFILE,CH)
  end;
  BREAK(OUTFILE);
  WRITE(OUT,N,' LINES CONVERTED.',NL);
  BREAK(OUT)
end;
 
begin {main program}
  INITFILES;
  CONVERT
end.
