locked
on error resume RRS feed

  • Question

  • User-854201065 posted

    Dear all,

    Im havin a code todo some attendance calculation for abt all the employees in my office.its an automatic pgm which will run at 7 am everyday and email the attendance list before 8am .

    if theres any error for one particular employee, pgm execution stops and cant continue.since its an automatic pgm i want pgm to run with next employee if the current employee calculation got some pblm.

    if i use on error resumenext statment if error occur at 11 thline of calculation, pgm still cont to 12th line and executing normal.i dun want it to be lik that.if the error is in 11th line then i want to stop execution of that particular employee and goto next employee....how to do this?

    Any help

     

    Wednesday, September 9, 2009 11:44 PM

Answers

  • User312496708 posted

    put a try catch block inside the main loop(inside the for loop), where you are looping all the employee. In case of any exception, log the exception. This way in case of exception for any one employee, will not hurt the loop for all employee and the calculation for other employee's will continue.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 10, 2009 12:12 AM

All replies

  • User312496708 posted

    put a try catch block inside the main loop(inside the for loop), where you are looping all the employee. In case of any exception, log the exception. This way in case of exception for any one employee, will not hurt the loop for all employee and the calculation for other employee's will continue.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 10, 2009 12:12 AM
  • User-854201065 posted

    Thanks vikram.im havin try catch.....jus for on error i commented those line.....

    could u give me eg for how to log the exception.? 

    Thursday, September 10, 2009 12:21 AM