Search Tools Links Login

InStr for lists


Visual Basic 6, or VB Classic

will search a listbox's contents for a string returning a True if the string exists and a False if it dosent

Original Author: Ridium

Inputs

lst = The Listbox
zString = The string to search the list for

Returns

True or False depending on if the string was found

Code

Function ListIsIn(lst As ListBox, zString As String) As Boolean
On Error Resume Next
For i = 0 To lst.ListCount
  If lst.List(i) = zString Then ListIsIn = True: GoTo grr
Next i
ListIsIn = False
grr:
End Function

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 104 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.