1 Attachment(s)
Code Placement ***Resolved***
I have to compare two lists of numbers to see if there is a match at all, if there is a match I have to award one point, if there is 2, I award two and so on...I have a program and the code to do it but I do not know where to place the code in order to carry out the process and how to display the number of points. Here is the code I was given and the program is attached:
Dim lngRetVal As Long
Dim intWins As Integer
Dim intIndex As Integer
Dim strPrize As String
For intIndex = 0 To lstUser.ListCount - 1
lngRetVal = SendMessageString(lstComp.hwnd, _
LB_FINDSTRING, -1&, _
lstUser.List(intIndex))
' lngRetVal is the ListIndex
If lngRetVal > -1& Then
intWins = intWins + 1
End If
Next
If intWins = 1 Then
strPrize = " prize."
Else
strPrize = " prizes."
End If
MsgBox "There was " & intWins & " match: you have won " & intWins & strPrize