Results 1 to 5 of 5

Thread: [RESOLVED] code question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Posts
    99

    Resolved [RESOLVED] code question

    i have 5 textboxes and they are set as arrays. i had a random number generator. when you guess i want the first guess in the first textbox..when you guess again i want the second guess to go into the second textbox and so on..how could i do this? can you use ForNext loops? THANK YOU

  2. #2
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: code question

    You should think out a pseudo-code first, it will make things alot easier...

    Then, just give it a shot and try it... if it doesn't work, show us your code and we can help you improve it.

    For now, your pseudo-code could look something like:

    - Create an array (variable) that can hold your 5 random numbers
    - Generate the random numbers and place them in the array
    - Use a ForNext loop to copy the variable values to your textboxes.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Posts
    99

    Re: code question

    Code:
        Randomize
        rand = (999 * Rnd + 1)
         
        guess = InputBox("Please Enter Your Guess")
        
        For x = 0 To 1
        txtguess(x) = guess
        Next x
    this is my code so far but its wrong..
    also if my guess is wrong how can i continue making inputboxes?

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: code question

    What constitutes a guess?

    A button click?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Posts
    99

    Re: code question

    Quote Originally Posted by Hack
    What constitutes a guess?

    A button click?

    yes..when i click start an inputbox pops up. then you enter your guess

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