%begin
%bytearray b(0:255)
%integer num,sym

!%routine show
!%integer start,stop
!  start = 0; stop = 0
!  %cycle
!    start = start+1 %while start<=255 %and b(start)=0
!    %exitif start>255
!    printsymbol(',') %unless stop=0; write(start,0)
!    stop = start
!    stop = stop+1 %while stop+1<256 %and b(stop+1)#0
!    write(-stop,0) %unless start=stop
!    start = stop+1
!  %repeat
!  newline
!%end

%routine show
%integer i
  %for i = 33,1,126 %cycle
    printsymbol(i) %if b(i)=0
  %repeat
  newline
%end

%routine clear
%integer i
  b(i) = 0 %for i = 0,1,255
%end

%routine read esc
%owninteger x=0
%option "-code"
  readsymbol(sym) %until sym=27
  skipsymbol %while nextsymbol=' '
  num = 0
  read(num) %if nextsymbol='-' %or '0'<=nextsymbol<='9'
  readsymbol(sym) %until sym#'-' %and sym#';' %and sym#' ' %andnot '0'<=sym<='9'
  %if sym='S' %start
    show %unless x=0
%option "-nocode"
    printstring("Font ")
    x = 0
    %cycle
      readsymbol(sym); %exitif sym=nl
      printsymbol(sym); x = x+1
    %repeat
    spaces(15-x)
    x = 1
  %elseif sym='K'
    b(num) = 1
  %else
    printstring("Esc"); write(num,0); space; printsymbol(sym); newline
  %finish
%end

%on 9 %start; show; %stop; %finish

printstring("File ".cliparam); spaces(15-length(cliparam))
openinput(1,cliparam)
clear
%cycle
  readesc
%repeat

%end
