And then ??
And then....
You have a copy of QB64 where the command behaves as you expect it to.
Everybody who has fixed his personal copy of QB64 is incompatible with the entire rest of the QB64 user base. Imagine you post a code snip which does invoke _INSTRREV in the way you want it (or what you believe is the right way), then this code will pobably give unexpected results to all users, who paste & run it in their own and most probably unpatched QB64 version.
So??
They’d just post a response of, “Doesn’t work for me.” Then you either tell them, “Patch QB64, or modify it to work on your system.”
It’s something we see all the time with code being shared. What works for one produces unexpected results for another — like for my Wallpaper Changer not working as expected for wide screen displays.
BTW - I fully agree with Fellippes stance on this function, but don't be in the mood for a war of words here. Following your discussions about this topic throughout the day just reminds to Clippy. Are you?
So, Fell’s reason for not wanting to fix it is, “It wasn’t found 10 months ago,” and, “Steve’s not a team player.” Your reason is, “Steve must be Clippy.”
Both of you are good at basically calling folks names, but that’s not going to do *anything* to convince me, or anybody else, that it performs better without the patch.
Show us even one example where the current method performs better.Currently you have to check for 2 things:
1) Is the result 0? If so, no more matches can be found.
2) Is the result 1? If so, we’re at the end of the search string; manually stop searching.
All the change does is eliminate the need for the second, unnecessary check. If you’re at the end of the string, logically, you can’t have any more matches. We should terminate at 0, not start back over at the far right of the search string and repeat the process again.
If INSTR behaved as _INSTRREV currently does, you’d have to check to make certain you stopped searching the string at the last byte in it, or else you’d start over fresh from the beginning. Would that somehow be a better way for INSTR to perform?
If not, then why do you think _INSTRREV should perform in such a manner?