Very nice. I was going to set a string to "0123456789" and a for loop and MID$, but this is good too.
Wow, as many ways to do it as snowflakes!
As for the EXIT fear. Now I see.
I have on occasion set a flag in a for loop and just let it run, it will keep going after its found what it needs.
Slower, but with no EXIT .001% more elegant I suppose.
As for a while/wend, you can decide when to get out and any good programmer should be looking for these outs. I expect them. I use them. *shrug*
I've seen nasty looking code and one with lots of exits is not among them IMHO
[skip this part if you don't care about c64 basic]
The thread link you posted asked "is it bad practice to use exit for?" and the answer "no" was posted.
I recall something about jumping out of for loops willy nilly in c64 basic. We didn't have the exit for, we just had goto.
So you can use it, fine, but you were leaving the for loop info on the stack! Not good! I don't know how you fix that, but at least for this case jumping out like that was bad. *shrug*