Hi Richard
just for anyone following along at home, I have written an enhanced strPos function that returns the minimum and maximum lengths as well as the usual start position:
It is currently a “work in progress” in that it is not extensively tested, but seems to work on my tests at home.
Richard’s idea of replacing the spaces seems like a good idea to me due to the clipping Richard mentioned. The code in the above link tries to find an unused replacement character for spaces.
I’m a bit skeptical/sceptical about that making a difference. I suspect you made some other code change that altered things - but happy to be surprised and shown I am wrong if you can provide an example demonstrating this.
well instring() works fine for me. There are a couple of “tricks” - the default skip amount is the length of the substring being searched for, whereas usually you want it to be 1. And also if you pass your substring in a string field, you may need to clip it if you don’t want to include the trailing spaces in your search.
I did find a bug in instring() around the turn of the century, where the substring was more than 255 chars, but that was corrected years back and I am not aware of any other bugs in it.