Home > Software engineering > On Error Goto to a function within two consecutive Error. What should I do?
On Error Goto to a function within two consecutive Error. What should I do?
Time:10-05
For the On Error Goto statement In the MSDN is so explain: If the error handler is active (in errors and executive Resume, Exit Sub, Exit Function or Exit Property statements between this period of time) and an error occurs, the current process of the fault handler will not be able to deal with this error, If the problem is that I need to use many times continuously is needed in a function On errorGoto statements for error conditions when jump, can't jump, in accordance with the requirements of the second start results such as the original code is as follows: On error Goto Lable1 1 'statements 1-3 processing object, may be because of the different attributes of object 1 error, error when want to jump to the statement, 11 starts processing object 2 Statements 1 Statements 2 Statement 3 Lable1: On error goto Lable2 '11-13 statement object 2, may be because the different attributes of objects 2 and error Statement 11 Statement of 12 Statement 13 Lable2: On error goto Lable3 'statement 21-23 processing object 3, may be because the different attributes of objects 3 and error Statement 21 Statement of 22 A statement 23 * * * * * * * * * * * * * * * * * * * * * * * * The overall train of thought: Is when the processing object 1 if an error, then jump to the processing object 2, if handled object 2 error, will jump to the object 3, But the problem is that the On error goto statements after processing error for the first time, subsequent to no matter use, when the object 1 error after the jump, Can't handle object 2 error jump, the entire program is stuck in there, Excuse me everybody, want how to deal with, Deal with each object's situation is more complex, so can't prejudge where could go wrong, might be wrong, of course, the condition of theAs much as possible in the program are given, Such a logic structure to how to deal with, thank you.
CodePudding user response:
You write under the label1 Err. Clear give it a try
CodePudding user response:
Can consider appropriately on the error resume next...