here in the following Code .Last value is 9000.When i debug suppose i=1 and cursor is on next .when i press f8 during debugging using f8.it goes on mcol.remove 1.again it becomes i=2
at the next time.and when press f8 it goes on mcol.remove 1. but i simple want to go if i want to
go on i=5000.not till i wait i increase upto 1,2,3....5000. is their any way to go directly on any specific number suppose i want to skip loop and i want to go directly on i=8500.Kindly let me know the idea.Any help would be highly appreciated.
Code:
Public Function RemoveAll() As Boolean
Dim i As Integer, last As Integer
last = mCol.Count
For i = 1 To last
mCol.Remove 1
Next
End Function
Last edited by firoz.raj; March 24th, 2010 at 03:28 AM.
That is not true, becaus he always removes column 1 and not column i.
But I think this was not the question...
You can set a breakpoint after the Next and then run until the breakpoint is encountered.
Although I have not yet worked with them, there are watched variables, as I recall, where you can set to break when a specific value is encountered.
As coded I do not see what good it would do you to skip to any specific number since you are always removing item 1 no matter what the variable = to. If you want to remove only 50 or 100 or whatever you could simply change the value of last at the top of the loop.
I think he just wants to 'skip' single stepping through the loop, not skipping execution, but continuing single stepping after say 8000 steps, without having to singlestep through all of it.
would allow to set a breakpoint to the debug.print i and let the loop run.
But I think setting a breakpoint after the Next does neatly. Why would you stop after 800 deletes and then go on single stepping. The deletes will work to the end, sure.
So you can resume single stepping after the loop.
Yes this is the way to stop at a defined point.
Your whole code would look like
Code:
Public Function RemoveAll() As Boolean
Dim i As Integer, last As Integer
last = mCol.Count
For i = 1 To last
if i = 8000 then
Debug.print i
end if
mCol.Remove 1
Next
End Function
And set F9 at the shown brown line
Jonny Poet
To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
If anyone felt he has got help, show it in rating the post.
Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ? My latest articles : Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7
With the mod function you can check to see if it is = to 0 and have it stop every 100 loops or whatever you choose to use in the mod statement. Just depends on what you want to do.
Code:
If i mod 100= 0 Then
Debug.Print i
End If
Would stop at loop 100 then you could step through one or two if you like and hit F5 and it would stop again at 200 and again at 300 and so on.
Again just depnds on what you want to do
Last edited by DataMiser; February 21st, 2010 at 11:02 PM.
Bookmarks