Подскажите пожалуйста, почему цифры не выводяться в текстовый документ gist.txt
туда должны выводиться цифры без нуля и 2
Фал с цирами прикреплен ниже.
Вот сам код
var
p,i,g:integer;
s: set of byte;     
f,l:text; ch:char;
begin
                                                        
 assign(f,'c:\trash.txt'); 
 reset(f);                 
 assign(l,'c:\gist.txt');
 rewrite(l);
 writeln('Ishodnii text:');        
 While not eof(f) do         
   begin
   read(f,ch);
   write(ch);  
   end;
 writeln;  
 reset(f);
 writeln('Text bez 0 i 2:');
 While not eof(f) do
   begin
   read(f,ch); 
   g:=ord(ch)-48;     
   if (g<>0)and(g<>2) then     
      if g=-16 then write(' ')      
               else write(g);
   end;
 reset(f);
                                           
 i:=1;        
 s:=[];
 write(l, i, ' ');       
  While not eof(f) do
   begin
   read(f,ch);
   g:=ord(ch)-48;
     if g=-16 then        
                begin
                  writeln(l);
                  p:=0;            
                  s:=[];           
                  i:=i+1;          
                  write(l, i, ' ');
                end
              else
                if not(g in s) then  
                                 begin
                                   p:=p+1;   
                                   include(s,g); 
                                 end;
   end;
 writeln(l);
 close(f);      
 close(l);   
 writeln;
 writeln('Process complete!');
 readln;
 end.