Joe Lewis Wilkins wrote: > Alain Pastor wrote: > > > <big snip> > > PRINT test$;" Joe's backward method:";FN TICKCOUNT - myTick&;" ticks" > > You could have been a little "kinder" and referred to it as "Joe's REVERSE > method:" *-} Hi Joe, My apologize if I made a boo boo. Is it unpolite to say backward in that case? > > > <more snip? > > > Here are the results on my G4/400: > > > > PPC 68K > > Old way forward search: 59 ticks 109 ticks > > Old way backward search: 6 ticks 11 ticks > > New way backward search: 2 ticks 2 ticks > > Very interesting, though it gets a little exaggerated by the extreme length of > the test str, so the real comparison on a PPC really only shows a difference of > less than a tenth of a second. In most cases negligible. I admit that it could be negligible in real situations, but I like to know that it is a bit faster. I tested the same demo prog with a$ = "This is an example" (notice the lack of the suffix) the results give: for both old methods : 16 ticks (PPC) and 28 ticks (68K) for the new method: 2 ticks (PPC and 68K) If you increase the size of a$ the amount of time taken seems to increase more rapidly with the old methods than with the new one, if I don't say something silly here. with a$ = "I longer to see this very boring and above all very long sentence reach its end", I got: both old ways: 62 ticks (PPC) and 117 ticks (68K) new way: 2 ticks (PPC) and 3 ticks(68K) > This NEW syntax, looks > an awful lot lot C. I hope we're not going "overboard" in that direction, which > can easily be done when your boat is only 2.5 meters long. (ted <grin>). Yes, it is C compatible syntax. I don't like C, but I love the new syntax in FB. Go figure! Well, at least, it seems to generate more efficient code. > > > Did you make any comparisons using the INSTR function that was proposed by some > of the other listers? Though I suppose the possibility of multiple "dots" pretty > much eliminates that approach? No, I didn't do that. Cheers Alain