[Implemted] FindString() default StartPosition = 1
[Implemted] FindString() default StartPosition = 1
Why is the Parameter 'StartPosition' not default/optimal with 1?
Re: FindString(String$, StringToFind$, StartPosition = 1)
It's an option so you can start searches anywhere in the string.
Is typing ",1" (only 2 characters) too much hassle for you?
Is typing ",1" (only 2 characters) too much hassle for you?

I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
Simple use a macro.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
maybe Leonhard does not use the third parameter...
but FindString reveals it's power only with using the third parameter...
but FindString reveals it's power only with using the third parameter...
Code: Select all
a$ = "the poop quick poop brown poop fox poop jumps poop over poop the poop lazy poop dog"
Pos = 0
Repeat
Pos = FindString( a$, "poop", Pos+1 )
Debug Pos
Until Pos = 0
oh... and have a nice day.
I personally agree, it would be nice if this parameter is made optional (dare I hazard a guess that it's usually '1' for a high percentage of people's programs?). I was reminded about this idea when I saw that in the latest beta:
I think this suggestion is vaguely in the same vein as this change.- Changed: last Mid() parameter optional