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 = "_"
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.
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.