04-04-2024, 03:29 AM
But your example is SEEDLESS. Great if you're growing grapes, but let's not wine about it...
So a couple of chop methods, but my initial contention was when we count in reverse, we should seed in reverse. I let that go, because there is at least a since of continuity that even though the searching part of the string has been reversed, the seeding order, from beginning to end, remains constant.
Pete
Code: (Select All)
' 1111111111222222222233333333
'1234567890123456789012345678901234567
'c:\root\mystuff\basic\qb64\myfile.bas
file$ = "c:\root\mystuff\basic\qb64\myfile.bas"
seed% = 1
Do
next_to_last$ = Mid$(file$, _InStrRev(Len(file$) - seed%, file$, "\") + 1)
Print seed%, next_to_last$
seed% = Len(next_to_last$) + 1
Loop Until seed% > Len(file$)
Print
seed% = Len(file$)
Do
next_to_last$ = Mid$(file$, _InStrRev(seed%, file$, "\") + 1)
Print seed%, next_to_last$
seed% = _InStrRev(seed%, file$, "\") - 1
Loop Until seed% < 0
End
So a couple of chop methods, but my initial contention was when we count in reverse, we should seed in reverse. I let that go, because there is at least a since of continuity that even though the searching part of the string has been reversed, the seeding order, from beginning to end, remains constant.
Pete