Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function token(subject as string,sep as string=",",index as string="1") as string
- dim as string buffer,Ln
- dim as long o,t,i
- buffer=subject:t=0:i=val(index)
- if val(index)>0 then
- do
- t=t+1
- o=instr(1,buffer,","):Ln=mid(buffer,o+1):buffer=mid(buffer,o+1)
- loop until t=val(index)
- token=Ln
- elseif index="ct" then
- do
- t=t+1
- o=instr(1,buffer,","):Ln=mid(buffer,o+1):buffer=mid(buffer,o+1)
- loop until o=0
- token=str(t)
- end if
- end function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement