Re: Questions...
- Posted by Ralf Nieuwenhuijsen <nieuwen at XS4ALL.NL> Feb 18, 1999
- 499 views
>I read this a hundred times and >I still don't understand anything of it. >Can you give an example ? Say, we're looking for 'e' in a string, but only for those on every 2nd place. declare_find ('e', "Maybe I should try to explain in Dutch") integer i i = find_next () while i / 2 != floor (i/2) or i = 0 do i = find_next () end while if i then puts (1, "Found a \'E\' at some 2nd place ") else puts (1, "Not found!") end if This is without the syntax. The new 'interface' of find allows us to do this, but now, it doesnt allow us to use it in the normal way, or to use it in the way you suggested (returning *all* results). This means, we would need to rewrite the *same* algorithm three times, for three different uses. Ralf