DAY 032: _INSTRREV
#10
Here's about the simplest and easiest example I can imagine for use with _INSTRREV:

Code: (Select All)
a$ = "This is a string of text for testing."
Print a$

Print "INSTR demo"
Do
    p = InStr(p + 1, a$, "i")
    If p Then Print "i found at position #"; p
Loop Until p = 0
Print
Print
Print "_INSTRREV demo"
p = Len(a$)
Do
    p = _InStrRev(p - 1, a$, "i")
    If p Then Print "i found at position #"; p
Loop Until p = 0


Start at the end of your text, work backwards, until you're at the front of your text.  It's just that simple. If you can use INSTR, then you shouldn't have any issues using INSTRREV.  Wink
Reply


Messages In This Thread
DAY 032: _INSTRREV - by Pete - 12-12-2022, 08:58 PM
RE: DAY 032: _INSTRREV - by vince - 12-12-2022, 09:10 PM
RE: DAY 032: _INSTRREV - by mnrvovrfc - 12-12-2022, 09:10 PM
RE: DAY 032: _INSTRREV - by vince - 12-12-2022, 09:39 PM
RE: DAY 032: _INSTRREV - by Pete - 12-12-2022, 10:20 PM
RE: DAY 032: _INSTRREV - by vince - 12-13-2022, 12:03 AM
RE: DAY 032: _INSTRREV - by Pete - 12-13-2022, 01:35 AM
RE: DAY 032: _INSTRREV - by vince - 12-13-2022, 02:02 AM
RE: DAY 032: _INSTRREV - by SMcNeill - 12-13-2022, 09:34 AM
RE: DAY 032: _INSTRREV - by mnrvovrfc - 12-13-2022, 11:16 AM
RE: DAY 032: _INSTRREV - by SMcNeill - 12-13-2022, 09:43 AM
RE: DAY 032: _INSTRREV - by Pete - 12-13-2022, 02:52 PM



Users browsing this thread: 4 Guest(s)