- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a list containing 'cat' and I do
ctext='Cat'//c
iret=SendMessage(hs,LB_FINDSTRINGEXACT,-1,loc(ctext))
iret is not LB_ERR but the location of 'cat'.
The documention says for LB_FINDSTRING - The search is case independent, so this string can contain any combination of uppercase and lowercase letters.
for LB_FINDSTRINGEXACT - The search is not case sensitive, so this string can contain any combination of uppercase and lowercase letters.
To me this does not make sence, or am I calling doing it wrong.
David
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LB_FINDSTRING finds the first string that BEGINS with the specified string, but ignoring case.
LB_FINDSTRINGEXACT finds the first string that EXACTLY matches the specified string , ignoring case .
I presume this to mean if you search for null-terminated string 'Character' and have null-terminated 'CHARACTERSTRING' and 'CHARACTER' strings in your list in that order, LBFINDSTRINGwillreturn the index for 'CHARACTERSTRING' whereas LBFINDSTRINGEXACTwillreturn the index for the 'CHARACTER' item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I search for null-terminated string 'Character' and have null-terminated 'CHARACTERSTRING' and 'CHARACTER' strings in my list -
I expected it to return LB_ERR as it couldn't find it as it wasn't an exact match.
I now see this isn't how it works.
Is there no way I can search for an exact match on an item in a list without stepping trough the items one by one?
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It looks like you will have to do your own case-sensitive search after an exactmatch is found to your searchstring and ifthat fails to throw up a match, you do another LB_FINDSTRINGEXACT search from the next item in the list, and so on. This requires you to get the text string using LB_GETTEXT (put it into foundstring) and then do your own test for equality using
IF(foundstring(1:index(foundstring,char(0)).eq.searchstring(1:index(searchstring,char(0)))
and so on.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page