home *** CD-ROM | disk | FTP | other *** search
- LParameters tcItemValue, tlCaseSensitive
-
- Local lnItem && a list-item counter
-
- * We only want to accept character-type search strings
- if type("tcItemValue") <> "C"
- tcItemValue = ""
- endif
-
- * We'll have two separate loops for case sensitivity and case insensitivity
- * for performance reasons
- if tlCaseSensitive
- * Loop through the list items, doing case sensitive matching
- for lnItem = 1 to this.ListCount
- if this.List(lnItem) = tcItemValue
- exit
- endif
- endfor
- else
- * Loop through the list items, doing case insensitive matching
- for lnItem = 1 to this.ListCount
- if lower(this.List(lnItem)) = lower(trim(tcItemValue))
- exit
- endif
- endfor
- endif
-
- * Return the item index at which the string was found, or 0 if no match
- return iif(lnItem > this.ListCount or empty(tcItemValue), 0, lnItem)
-