Results 1 to 7 of 7

Thread: [RESOLVED][2005] Simple loop question

Threaded View

  1. #1

    Thread Starter
    Addicted Member Abrium's Avatar
    Join Date
    Feb 2007
    Location
    The Great State of Texas
    Posts
    205

    Resolved [RESOLVED][2005] Simple loop question

    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:
    1. Dim intCount as Integer = 1
    2. Dim intInput as Integer
    3. InInput = CInt(InputBox("Please enter a number to be stored",,CStr(1)))
    4. Do Until intCount = 10
    5. intcount += 1
    6. Loop
    7. 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 point Let me know what you guys think.

    Abe
    Asking the beginners questions so you don't have to.
    Last edited by Abrium; Feb 26th, 2007 at 05:56 AM. Reason: Resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width