>Cetin,
>
>You never have to use PMFJI. We've been friends for too long for you to have to use that.< s >
>
>To answer you're question...I don't know. It might be faster with one of the "evils", but by how much? IOW, would it really make a significant difference? I don't think so.
>
>Regards,
Thanks friend,
As this thing turned out to be an academic thing I made a test with multiple RETURNs version and it was around 50% faster.
It was beaten by Walter's highly clever approach:) Very nice code Walter.
A code like that would be optimized in case it'd be called n thousand times. Otherwise a plain vanilla for...exit...endfor would do and it wouldn't expect a sorted array nor you'd not only get back only a found @ but might request first or last occurence, right? If so I've around 7-8 times faster code than Walter's but I simply assumed it'd be called at least n thousand times and made a little one time preparation (cheated IOW and put the array in a cursor and indexed, BTW in all tests I added a nSearchCol for a multicol array - out of competition I accept:)
The question was multiple RETURNs, EXIT are evils or not. To me they're not and when makes sense they should be used (in my daily coding they make sense often:).
Cetin