Reverse find string

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Reverse find string

Post 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.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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)
oh... and have a nice day.
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post by tinman »

The current FindString() has a start position parameter, so I guess it could be like that.

Position = RFindString(String$, StringToFind$, StartPosition)
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Dummy
Enthusiast
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

Post by Dummy »

I needed that one several times, too.
horst
Enthusiast
Enthusiast
Posts: 197
Joined: Wed May 28, 2003 6:57 am
Location: Munich
Contact:

Re: Reverse find string

Post 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
Horst.
Post Reply