Page 1 of 1

FindString bug

Posted: Sat Mar 05, 2016 6:08 am
by kpeters58
5.42 64bit Windows:

This returns 0

Code: Select all

Debug FindString("Inkl. Adress-Daten", "adress", #PB_String_NoCase)
and this does not

Code: Select all

Debug FindString("Inkl. Adress-Daten", "Adress", #PB_String_NoCase)
Clearly both should find it.

Re: FindString bug

Posted: Sat Mar 05, 2016 6:16 am
by RASHAD
The position parameter must be used

Code: Select all

Debug FindString("Inkl. Adress-Daten", "adress",0, #PB_String_NoCase)

Re: FindString bug

Posted: Sat Mar 05, 2016 8:03 am
by Little John
RASHAD wrote:The position parameter must be used
Yes, but
[u]Reference Manual[/u] wrote:The first character index is 1.
:-)

Code: Select all

Debug FindString("Inkl. Adress-Daten", "adress", 1, #PB_String_NoCase)

Re: FindString bug

Posted: Sat Mar 05, 2016 6:32 pm
by RASHAD
Hi LJ
In that case you can consider 0 as
If this parameter isn't specified, the whole string is searched.
:P

Re: FindString bug

Posted: Sat Mar 05, 2016 6:41 pm
by ts-soft
RASHAD wrote:Hi LJ
In that case you can consider 0 as
If this parameter isn't specified, the whole string is searched.
I would use #PB_Any in this case, but all is working :wink:

Re: FindString bug

Posted: Sat Mar 05, 2016 7:16 pm
by Little John
RASHAD wrote:In that case you can consider 0 as
If this parameter isn't specified, the whole string is searched.
I don't think so.
"If this parameter isn't specified" means, if you write something like

Code: Select all

Debug FindString(String$, StringToFind$)
In your code above, you did specify the third parameter (= passed the value 0 for it).
The third parameter specifies the start position, but there is no 0th start position.

Re: FindString bug

Posted: Sat Mar 05, 2016 7:48 pm
by RASHAD
First of all logically the position must be specified to count the occurrence of the target from
The manual said the first position is 1 and that we can call a specified position
0 (Null) Means not specified
It can not be Void while there is some other parameter we can use