Debugging a loop

A

A Mad Doberman

All,

I assume this question is pretty basic to someone in the know....I
have problems with a FOR loop, but the problem doesn't occur until the
end on the FOR loop (last few runs). I'm trying to debug it, but there
has to be an easier way! The loop runs through 500 times.

Is there any way to automatically skip to any one point in the loop to
debug starting at that point?

My loop is something like:

For i = 1 to 500
code
Next i

Can I somehow begin debugging at i = 495, for example?

Thanks all!
 
J

Jim Rech

For i = 1 to 500
If i = 495 Then Stop
code
Next i

--
Jim
| All,
|
| I assume this question is pretty basic to someone in the know....I
| have problems with a FOR loop, but the problem doesn't occur until the
| end on the FOR loop (last few runs). I'm trying to debug it, but there
| has to be an easier way! The loop runs through 500 times.
|
| Is there any way to automatically skip to any one point in the loop to
| debug starting at that point?
|
| My loop is something like:
|
| For i = 1 to 500
| code
| Next i
|
| Can I somehow begin debugging at i = 495, for example?
|
| Thanks all!
 
G

Gary Keramidas

you can also set a watch:

click debug then add watch
enter i = 495 in the expression box and select the option to break when value is
true

then you can use F8 to step through your code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top