Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Apr : displaying error message

www.cryer.info
Managed Newsgroup Archive

displaying error message

Subject:displaying error message
Posted by:"Glenn Greatwood" (glenngreatwo..@yahoo.co.uk)
Date:Mon, 17 Apr 2006 08:35:17 +0100

Hi

Delphi 4, Paradox tables

I use the following code to create a zip file;

//Write the backup.bat file
AssignFile(MyFile,'c:\BackupDir\Backup\Backup.Bat');
rewrite(MyFile);
WriteLn(MyFile,'@echo off');
WriteLn(MyFile,'path c:\BackupDir\Backup');
WriteLn(MyFile,'pkzip -r '+DIR+'KeyBack '+ DirSource);
CloseFile(MyFile);

Works fine, but if for some reason the file can't be created (maybe a
previous version exists that is read only) no error message is displayed and
the DOS window is just closed. Hio can I grab the error and display the fact
that the file couldn't be created?

Thansk for your time.

Regards

Glenn

Info

Glossary

File Types

Replies:

www.cryer.info
Managed Newsgroup Archive