|
-
Dec 3rd, 2005, 12:00 PM
#1
Thread Starter
New Member
need help creating a loop
I am doing a hangman assignment , I need the application to display the correct amount of dashes"_" when player one enters his word. Here is my code so far. I was told I need to do a loop but I cannot figure it out for nothing.
'get a 5-letter word from the first player
Do
word = InputBox("Enter a word", "Hangman Game")
Loop Until word.Length = word.Length
'convert to uppercase
word = word.ToUpper()
Me.uiWordLabel.Text = "_"
-
Dec 3rd, 2005, 12:17 PM
#2
Re: need help creating a loop
Welcome to the forums!
To convert to uppercase, in VB6, use Ucase()
You don't need a loop if the user is inputting a whole word. Do you want them to input it one letter at a time? If so, then you would need a loop, and have some way of exiting it.
I don't think you want a loop for the input.
-
Dec 3rd, 2005, 12:23 PM
#3
Thread Starter
New Member
Re: need help creating a loop
Yes, they are putting in one letter at a time. That is what the assignment states. Maybe I need to clarify I need the wordlabel to show the same amount of dashes as the letters in the word that player 1 enters.
Last edited by southman_70; Dec 3rd, 2005 at 12:43 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|