Page 1 of 1

Reverse find string

Posted: Fri Aug 10, 2007 9:27 pm
by tinman
I'd like to see a RFindString() or something which searches for a string from the end of the searched string.

It was hinted at here http://www.purebasic.fr/english/viewtopic.php?t=20761 but not explicitly asked for as a command.

Posted: Fri Aug 10, 2007 9:31 pm
by Kaeru Gaman
additionally, it would be nice if it would be a "batch" command,
that finds the next position if called more than once.
(like e.g. the EnumDisplaySettings API-call)

Posted: Fri Aug 10, 2007 9:35 pm
by tinman
The current FindString() has a start position parameter, so I guess it could be like that.

Position = RFindString(String$, StringToFind$, StartPosition)

Posted: Fri Aug 10, 2007 11:47 pm
by Dummy
I needed that one several times, too.

Re: Reverse find string

Posted: Sat Aug 11, 2007 9:16 am
by horst
I wrote a bidirectional search routine for my MemPad. It is very convenient to be able to search back and forth with just a mouse click (a feature that would be nice for the PB IDE as well)

Source Snippet: http://www.purebasic.fr/english/viewtop ... 409#206409