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

Posted on 2008-11-09
Last Modified: 2013-12-14
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.
Question by:Chrysaor
    LVL 39

    Expert Comment

    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.

    Expert Comment

    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;
    LVL 1

    Accepted Solution

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
    Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
    The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
    The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now