473,387 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Retry on exception

Hi,
It may a simple question but i needed to verify. I hava a for-next
loop and when an exception occurs, i don't want my program to the jump
out of try-catch block and i want it to retry the operation again.

Here is what i meant:

Try

Dim x as integer
For x=0 to 10
<Codeline1>
Next

Catch
'Error message
<Codeline2>

End Try

'Operation ended
<Codeline3>
At this code when the program processing for example 3rd (x) item in
for-next loop and if an exception is thrown, <Codeline2is executed
as well, then it jumps to <Codeline3>.

My aim is that when an exception is thrown on any for-next (x) item,
the program must ignore it or notice as messagebox then "continue"
processing operation till it reaches the end of for-next loop (x=10)
instead of jumping outside try-catch block and interrupting operation.

How can i do this?

Thanks!
Feb 10 '08 #1
3 1345
Kimi,

As I understand you well, then normally I would set the try and catch
complete inside the for loop.

Cor

Feb 10 '08 #2

"kimiraikkonen" <ki*************@gmail.comkirjoitti viestissä
news:23**********************************@v46g2000 hsv.googlegroups.com...
Hi,
It may a simple question but i needed to verify. I hava a for-next
loop and when an exception occurs, i don't want my program to the jump
out of try-catch block and i want it to retry the operation again.
On Error Goto...
On Error Resume

Try looking for these keywords.

-Teemu

Feb 10 '08 #3
On Feb 10, 1:38 pm, "Cor Ligthert[MVP]" <notmyfirstn...@planet.nl>
wrote:
Kimi,

As I understand you well, then normally I would set the try and catch
complete inside the for loop.

Cor
Thanks Teemu and Cor, i put try-catch block inside my loop and works.
Feb 10 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Robert Brewer | last post by:
Alex Martelli wrote in another thread: > One sign that somebody has moved from "Python newbie" to "good Python > programmer" is exactly the moment they realize why it's wrong to code: > > ...
7
by: Antoine De Groote | last post by:
Hi, I hope I don't upset anybody by comparing Python to Ruby (again). Is there something like Ruby's retry keyword in Python? I couldn't find any thing... Regards, antoine
8
by: Adil Akram | last post by:
There are situations where you want to retry/rerun the same code again (if user wants) for unlimited times for a particular exception thrown. For example in situations like there's no CD in the...
1
by: Nimral | last post by:
Hi folks, is there a smart way to develop efficiently that helps me in the following situation: a sub calls a subsub, which calls a subsubsub, and so on. Within a subsubsub an error occurs...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.