Case insensitive search not working at FindString [invalid]

Just starting out? Need help? Post your questions and find answers here.
wb2k
User
User
Posts: 18
Joined: Sun Feb 09, 2014 1:22 am

Case insensitive search not working at FindString [invalid]

Post by wb2k »

Edit: As Little John mentioned, Mode is the 4th parameter, so correct code would be: FindString("PureBasic", "BAS", 0, #PB_String_NoCase)

According to the manual FindString's optional parameter "Mode" allows to do a case insensitive search with #PB_String_NoCase: https://www.purebasic.com/documentation ... tring.html

However, the following code

Code: Select all

Debug FindString("PureBasic", "Bas")
Debug FindString("PureBasic", "BAS")
Debug ""
Debug FindString("PureBasic", "Bas", #PB_String_CaseSensitive)
Debug FindString("PureBasic", "BAS", #PB_String_CaseSensitive)
Debug ""
Debug FindString("PureBasic", "Bas", #PB_String_NoCase)
Debug FindString("PureBasic", "BAS", #PB_String_NoCase)
outputs

Code: Select all

5
0

5
0

5
0
So Debug FindString("PureBasic", "BAS", #PB_String_NoCase) prints out 0 where it should print out 5.
Last edited by wb2k on Sun Sep 03, 2017 2:14 pm, edited 1 time in total.
Alex777
User
User
Posts: 49
Joined: Sun Nov 16, 2008 12:47 am
Location: Cayman Is.
Contact:

Re: [5.60] Case insensitive search not working at FindString

Post by Alex777 »

Same result here with PB 5.45 LTS x86.
Little John
Addict
Addict
Posts: 4785
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: [5.60] Case insensitive search not working at FindString

Post by Little John »

wb2k wrote:According to the manual FindString's optional parameter "Mode" allows to do a case insensitive search with #PB_String_NoCase: https://www.purebasic.com/documentation ... tring.html

However, the following code

Code: Select all

Debug FindString("PureBasic", "Bas")
Debug FindString("PureBasic", "BAS")
Debug ""
Debug FindString("PureBasic", "Bas", #PB_String_CaseSensitive)
Debug FindString("PureBasic", "BAS", #PB_String_CaseSensitive)
Debug ""
Debug FindString("PureBasic", "Bas", #PB_String_NoCase)
Debug FindString("PureBasic", "BAS", #PB_String_NoCase)
Please look again into the manual, and then tell us whether "Mode" is the 3rd or the 4th parameter. :mrgreen:
Alex777
User
User
Posts: 49
Joined: Sun Nov 16, 2008 12:47 am
Location: Cayman Is.
Contact:

Re: [5.60] Case insensitive search not working at FindString

Post by Alex777 »

Ahhh! [slaps forehead] You are absolutely right. No bug there. :oops:
wb2k
User
User
Posts: 18
Joined: Sun Feb 09, 2014 1:22 am

Re: [5.60] Case insensitive search not working at FindString

Post by wb2k »

Little John wrote:Please look again into the manual, and then tell us whether "Mode" is the 3rd or the 4th parameter. :mrgreen:
Ohhh, should have seen this. Thanks for clarifying this!
I'm marking the original post as invalid.
Post Reply