How to ignore errors (using Borland C++ Builder)

I've created an application which performs various tasks automatically (e.g copying a file, deleting a file etc). But sometimes, various errors can pop up (e.g trying to copy a file when used by another application , and generally any other possible error in the code) .
I would like my application to ignore any error comes in the way, and then restart its task all over again. Is this possible?

Thanks a lot.
Who is Participating?
danaceConnect With a Mentor Commented:
have you tried try..catch..statements? Maybe you are referring to the "On Error Resume" equivalent in VB. But I think there is none of that in BCB
evilrixSenior Software Engineer (Avast)Commented:
Can you give a more concrete example? This is a little bit like asking how long is a piece of string. The action you take will be directly dependent upon what it is you are actually doing. Some example code wouldn't hurt none either.
You can check each operation you perform to see if it succeeds and take appropriate action if it does not:

if( !CopyFile( sSrcFile.c_str(), sDestFile.c_str(), false ) )
          String sMsg = "CopyFile failed. See log file";
          ShowMessage( sMsg );
          return false;
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.