Results 1 to 4 of 4

Thread: Code Placement ***Resolved***

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Location
    Edinburgh, Scotland, UK
    Posts
    14

    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
    Attached Files Attached Files
    Last edited by jacobite; Dec 12th, 2002 at 01:15 PM.
    Jacobite

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width