Sub guessLetter(letterGuess As String)
Dim lengthOfSecretWord As Integer
lengthOfSecretWord = Len(Secret_word) - 1
tempWord = ""
Dim letterPosition As Integer
For letterPosition = 0 To lengthOfSecretWord
If Mid(Secret_word, letterPosition, 1) = letterGuess Then
tempWord = tempWord & letterGuess
Else
tempWord = tempWord & Mid(lblTempWord, letterPosition, 1)
End If
Next
lblTempWord = tempWord
End Sub
I have runtime error "5" and the problem in line IF, i'm stuck to declare Secret_word.substr(letterPosition, 1) on vb6, first i try write Secret_word.substr(letterPosition, 1) but it can't then i try to manipulate that then runtime error 5 came
Invalid procedure call or argumentfor those who dont have all the error codes from a 20 year old product memorizedOption Explicitand declare all your variables. Your issue is with theForloop... start at 1, not 0.