Off the top of my head:
[edit]
Heres my function after converting frmo Visual Basic, without BB.
Heres the function as I originally wrote it, Still untested
Not sure if that will do what you need, but I knocked it up without documents or anything, so it will likely have a couple of bugs.
[edit]
Heres my function after converting frmo Visual Basic, without BB.
Function Gettextsection(inp$,sep$,index) local last = 1,cnt,ins,out$,olast repeat ins = InStr(inp$, sep$,last) If ins = 0 Then ins = Len(inp$) If ins > 0 Then olast=last: Cnt = Cnt + 1: last = ins + 1 Until ins = 0 Or Cnt = index or index=0 If olast>0 then out$ = Mid$(inp$, olast, ins - olast) Return Out$ End Function
Heres the function as I originally wrote it, Still untested
Function index(inp$,tok$,getindex) local Lastpos=1 local curcount=0 local ins local out$ repeat ins=instr(inp$,tok$,lastpos) if ins>0 then out$=mid$(inp$,lastpos,ins):lastpos=ins+1:curcount=curcount+1 ;Thanks Grey Alien!!!! :P :P :P until curcount=index or ins=0 if curcount=getindex then return Out$ end function
Not sure if that will do what you need, but I knocked it up without documents or anything, so it will likely have a couple of bugs.