 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
klwong
Joined: 07 Mar 2009 Posts: 22 Country: Australia |
|
Error handling within FORNEXT loop |
|
I have the following coding:
FORNEXT .... XYZ
statements
ONERROR GOTO ABC
statement
CONTINUE
ABC:
error handling statement
CONTINUE
XYZ:
Looks like when the script hits the error, it will jump to lablel ABC and execute the error handling statement, but then it will exit the FORNEXT loop. Are there anyway to continue the loop ??
|
|
Tue Nov 10, 2009 5:06 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
You should move the following block of code to a user defined statement and call it from the loop. In that case error handling occurred inside the user-defined statement won't interrupt the loop.
ONERROR GOTO ABC
statement
CONTINUE
ABC:
error handling statement
|
|
Wed Nov 11, 2009 10:30 pm |
|
 |
klwong
Joined: 07 Mar 2009 Posts: 22 Country: Australia |
|
|
|
But how do I make the loop to continue and just report the error and continue ?
|
|
Thu Nov 12, 2009 5:20 am |
|
 |
klwong
Joined: 07 Mar 2009 Posts: 22 Country: Australia |
|
|
|
Test and got it work... Many thanks for the comments.
|
|
Thu Nov 12, 2009 6:01 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
You are welcome. I'm glad it works for you.
|
|
Thu Nov 12, 2009 7:55 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|