%begin
   %include "level1:graphinc.imp"
   %own %string(255) status = ""
   %routine status sym(%integer s)
      %own %string(255) new stat = ""

      %if s=nl %start
         status = new stat
         new stat = ""
      %else
         new stat <- new stat.to string(s)
      %finish
   %end

   %routine put sym(%integer s)
      %own %string(255) new text = ""
      %own %integer y = 0

      %routine clear(%integer by, ty)
         colour(black)
         ty = ty&1023
         by = by&1023
         %if by<ty %start
            fill(0, by, 687, ty)
         %else
            fill(0, by, 687, 1023)
            fill(0, 0, 687, ty)
         %finish
         colour(white)
      %end

      %if s=nl %start
         clear(y-12, y-1)
         text at(0, y-12)
         show string(status)
         clear(y, y+11)
         text at(0, y)
         show string(new text)
         y = (y-12)&1023
         offset(0, y)
         new text = ""
      %else
         new text <- new text.to string(s)
      %finish
   %end
   %string(255) file
   %integer s
   %on %event 9 %start; print symbol(27); print symbol('R'); %stop; %finish
   clear
   file = cliparam
   open input(1, file)
   status sym(charno(file, s)) %for s = 1, 1, length(file)
   status sym(nl)
   %cycle
      read symbol(s)
      put sym(s)
   %repeat
%end %of %program
