home *** CD-ROM | disk | FTP | other *** search
- (* ------------------------------------------------------ *)
- (* ERRORTST.PAS *)
- (* Testprogramm für die Unit ErrorMsg *)
- (* ------------------------------------------------------ *)
- PROGRAM ErrorTest;
-
- USES Crt, ErrorMsg;
-
- VAR
- f : FILE;
- NameAlt, NameNeu : STRING;
-
- BEGIN
- ClrScr;
- GotoXY(25,8);
- Write('*** Umbenennen von Dateien ***');
- REPEAT
- GotoXY(25,10); Write('Alter Dateiname: ');
- ReadLn(NameAlt);
- GotoXY(25,12); Write('Neuer Dateiname: ');
- ReadLn(NameNeu);
- Assign(f, NameAlt);
- {$I-}
- Rename(f, NameNeu);
- {$I+}
- { Übergabe des Fehlercodes an die Prozedur }
- ErrorReport(IOResult);
- GotoXY(25,14); Write('Weitermachen (J/N) ? ');
- UNTIL Upcase(ReadKey) <> 'J';
- END.
- (* ------------------------------------------------------ *)