Help! #PB_String_NoCase with FindString stopped working
Posted: Wed Sep 09, 2020 9:46 pm
The following FindString #PB_String_NoCasecode always worked before, but it stopped working in this latest version?
I really need this fixed, as I use it a lot in some of my code. I now have to revert back to using LCase or UCase for each FindString.
I really need this fixed, as I use it a lot in some of my code. I now have to revert back to using LCase or UCase for each FindString.
Code: Select all
;; ----------------------------------------------------
; last modified: September 9th, 2020 @ 2:54:35 PM
; ----------------------------------------------------
;using pb version PureBasic 5.72 (Windows - x86)
dat$="Brent Hauble"
p1=FindString(dat$,"Hauble",#PB_String_NoCase)
Debug "p1 = "+p1
If FindString(dat$,"Hauble",#PB_String_NoCase)>0
check=1 ;works because it's a match
EndIf
p2=FindString(dat$,"HAUBLE",#PB_String_NoCase)
Debug "p2 = "+p2
If FindString(dat$,"HAUBLE",#PB_String_NoCase)>0 ;case insensitive search (A=a).
check=2 ;#PB_String_NoCase is not working. Why ? It was working in the last PB version
EndIf
Debug "check = "+check ;check = 1
dat$="Brent HAUBLE"
If FindString(dat$,"Hauble",#PB_String_NoCase)>0
check=3 ;#PB_String_NoCase is not working. Why ? It was working in the last PB version
EndIf
If FindString(dat$,"HAUBLE",#PB_String_NoCase)>0 ;case insensitive search (A=a).
check=4 ;works because it's a match
EndIf
Debug "check = "+check ;check = 4
;I now have to revert back to using LCase or UCase
Srchdat$="Hauble"
Dat2Find$=LCase(Srchdat$)
If FindString(LCase(dat$),Dat2Find$)>0
check=5
EndIf
Debug "check = "+check ;check = 5