home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TOOLS4.ZIP / TSTTOOLS.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-08-30  |  801 b   |  46 lines

  1. {
  2.   Simple test program of TOOLS unit.  Takes a pascal file as
  3.   input and displays it to the screen with all begin and end
  4.   keywords capitalized.
  5. }
  6.  
  7. {$I+}
  8.  
  9. program TstTools;
  10.  
  11. uses Tools;
  12.  
  13. var
  14.   InStr,OutStr,FName
  15.                    : String;
  16.   F                : Text;
  17.  
  18.  
  19. const
  20.   _BEGIN           : String[5] = 'BEGIN';
  21.   _END             : String[3] = 'END';
  22.  
  23. begin
  24.   Write('Enter filename      : ');
  25.   ReadLn(FName);
  26.  
  27.   if (Fname = '') then Halt(2);
  28.  
  29.   Assign(F,FName);
  30.  
  31.   {$I-}
  32.   Reset(F);
  33.   if IOResult <> 0 then begin
  34.     WriteLn(FName,' not found.');
  35.     Halt(1);
  36.   end;
  37.   {$I+}
  38.   while not EOF(F) do begin
  39.     ReadLn(F,InStr);
  40.     ReplaceString(_BEGIN,_BEGIN,InStr);
  41.     ReplaceString(_END,_END,InStr);
  42.     WriteLn(InStr);
  43.   end;
  44.   Close(F);
  45. end.
  46.