CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Type Mismath

  1. #1
    Join Date
    Jan 2000
    Posts
    6

    Type Mismath

    Can anyone tell me why this code is giving my a type mismatch error?
    [vbcode]
    Public Function qualitylook()
    Dim n As Integer
    Dim Qual As String

    For n = 0 To lstFoundBrit.ListCount
    Qual = lstFoundBrit.List(n)
    lstFoundBrit.ListIndex = 0
    If Left(Qual, 2) <> 1 Then
    lstFoundBrit.RemoveItem (lstFoundBrit.List(lstFoundBrit.ListIndex))
    End If
    Next n
    End Function


    Thanx for the help,
    Detard


  2. #2
    Join Date
    Jan 2000
    Location
    CA
    Posts
    52

    Re: Type Mismath

    If you are declaring this as a function, it must return a value. The code snippet you have provided should be called a Sub vice a function because it does not return a value.


  3. #3
    Join Date
    May 1999
    Posts
    3,332

    Re: Type Mismath

    >lstFoundBrit.RemoveItem (lstFoundBrit.List(lstFoundBrit.ListIndex))


    Looks wrong to me:
    removeItem takes an integer, .List returns a string.


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

Featured