Hey when i go to run my code i get this compile error:
Compile Error Methord or data member not found. i tried to debug this myself but i cant see why the error is occuring. I am making a simple hang-man game i will link the code below.
I am very new to any type of programming please could you reply in terms i can understand :P.
Compile Error Methord or data member not found. i tried to debug this myself but i cant see why the error is occuring. I am making a simple hang-man game i will link the code below.
Code:
Option Explicit
Private StrGuessLetter As String
Private ArrWord As Variant
Private ArrLetters As Variant
Private IntTotalLetters As Integer
Private strWord As String
Private Sub Command1_Click()
Dim i As Integer
strWord = txtword.Text
txtword.Text = "-"
IntTotalLetters = Len(strWord)
ReDim ArrWord(IntTotalLetters) As String
ReDim ArrLetters(IntTotalLetters) As String
For i = 1 To IntTotalLetters
ArrWord(i) = Mid(strWord, i, 1)
ArrLetters(i) = "-"
txtword.Text = txtword.Text & ArrLetters(i) & " "
Next
End Sub
Private Sub Command2_Click()
Dim i As Integer, o As Integer
Dim blnGuess As Boolean
StrGuessLetter = txtguessletter.Text
txtguessletter.Text = vbNullString
For i = 1 To IntTotalLetters
If ArrWord(i) = StrGuessLetter Then
ArrLetters(i) = StrGuessLetter
txtword.Text = vbNullString
For o = 1 To IntTotalLetters
txtword.Text = txtword.Text & ArrLetters(o) & " "
Next
blnGuess = True
Else
If blnGuess Then
Else
blnGuess = False
End If
End If
Next
If blnGuess = False Then
lblGuesses.Caption = lblGuesses.Caption & " " & StrGuessLetter
End If
If InStr(1, txtword.Text, "-") = 0 Then
Labell.Caption -"Winner"
Else
Label.Caption = "Enter your next letter"
End If
End Sub
I am very new to any type of programming please could you reply in terms i can understand :P.
Comment