I have a simple loop question. I have played with this for sometime but I seem to not be able to get my desired output. I just want a simple loop that runs until the counter = 10 and stores the variable result in a listbox. The problem I am having is that I can not seem to get the loop to stop taking information. Can someone give me a hand as to how to make this loop stop?
VB Code:
Dim intCount as Integer = 1 Dim intInput as Integer InInput = CInt(InputBox("Please enter a number to be stored",,CStr(1))) Do Until intCount = 10 intcount += 1 Loop lstNumbers.Items.Add(intInput)
Now why is it this loop continues to accept information after the counter reaches 10? Is it because its a prompted response from the user or am I leaving out some form of input validation?
As always I have searched but the problems that I search on this board are from people that are usually devs with real world problems. I'm just trying to understand the fundamentals at this pointLet me know what you guys think.
Abe
Asking the beginners questions so you don't have to.




Let me know what you guys think.
Reply With Quote