locked
How to handle exception? RRS feed

  • Question

  • Hello.
    I have void which changes text of the label to value from the array.
    I have got the problem. Sometimes the application set the value of variable I have stored array index in to value higher than is allowed. Then, I have IndexOutOfRange exception. How to handle it? For example is there something like:
    EventHandler.IndexOutOfRange.handle = myHandlingVoid();
    ??
    Thanks
    Thursday, August 20, 2009 8:21 AM

Answers

  • try{
    // do you struff
    }
    catch(IndexOutOfRangeException ex)
    {
      // do your exception handling
    }
    • Proposed as answer by Oleksandr Klymenko Thursday, August 20, 2009 8:43 AM
    • Marked as answer by Khubajsn Friday, August 21, 2009 1:37 PM
    Thursday, August 20, 2009 8:24 AM