SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Error handling within FORNEXT loop

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Error handling within FORNEXT loop
Author Message
klwong



Joined: 07 Mar 2009
Posts: 22
Country: Australia

Post Error handling within FORNEXT loop Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
klwong



Joined: 07 Mar 2009
Posts: 22
Country: Australia

Post Reply with quote
But how do I make the loop to continue and just report the error and continue ?
Thu Nov 12, 2009 5:20 am View user's profile Send private message
klwong



Joined: 07 Mar 2009
Posts: 22
Country: Australia

Post Reply with quote
Test and got it work... Many thanks for the comments.
Thu Nov 12, 2009 6:01 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
You are welcome. I'm glad it works for you.
Thu Nov 12, 2009 7:55 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.