home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / STRNFST2.ZIP / RESTORE.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1987-01-25  |  1.1 KB  |  53 lines

  1. program restore;
  2. {$V-,U+}
  3. (*
  4. This program is designed to strip from inline code
  5. produced by Dave Baldwin's Inline.com program everything that Inline
  6. added to the input file.  It does this by stripping all lines up
  7. to and including the left brace, and truncating lines before the
  8. right brace.  If you have added other things to the file,
  9. it is not then ready for inputting to Inline.  If you did not
  10. add anything, it is.
  11.  
  12.     C>restore infile outfile
  13. *)
  14.  
  15. type longstring = string[255];
  16.  
  17. var
  18.    filename:  string[36];
  19.    infile, outfile: text[$2000];
  20.    tline: longstring;
  21.  
  22. procedure get_files;
  23.  
  24.  begin
  25.   assign(infile, ParamStr(1));
  26.   reset(infile);
  27.   assign(outfile, ParamStr(2));
  28.   rewrite(outfile);
  29.  end;
  30.  
  31. procedure close_files;
  32.  
  33.  begin
  34.   close(infile);
  35.   close(outfile);
  36.  end;
  37.  
  38.  
  39. begin
  40.  get_files;
  41.  while not eof(infile) do
  42.   begin
  43.    readln(infile, tline);
  44.    if (tline <> 'Inline(') and (tline <>');') then
  45.     begin
  46.      delete (tline,1, pos('{',tline));
  47.      if pos('}',tline)>0 then tline[0] := chr(pos('}',tline) - 1);
  48.      writeln (outfile,tline);
  49.    end;
  50.   end;
  51. close_files;
  52. end.
  53.