home *** CD-ROM | disk | FTP | other *** search
- {
- Simple test program of TOOLS unit. Takes a pascal file as
- input and displays it to the screen with all begin and end
- keywords capitalized.
- }
-
- {$I+}
-
- program TstTools;
-
- uses Tools;
-
- var
- InStr,OutStr,FName
- : String;
- F : Text;
-
-
- const
- _BEGIN : String[5] = 'BEGIN';
- _END : String[3] = 'END';
-
- begin
- Write('Enter filename : ');
- ReadLn(FName);
-
- if (Fname = '') then Halt(2);
-
- Assign(F,FName);
-
- {$I-}
- Reset(F);
- if IOResult <> 0 then begin
- WriteLn(FName,' not found.');
- Halt(1);
- end;
- {$I+}
- while not EOF(F) do begin
- ReadLn(F,InStr);
- ReplaceString(_BEGIN,_BEGIN,InStr);
- ReplaceString(_END,_END,InStr);
- WriteLn(InStr);
- end;
- Close(F);
- end.