SplitStr

Treats a delimited string as an array. Requires CountInStr to work. WORD$ works essentially the same way, and is probably a better choice in most instances.

code format="vb" ' Returns a string based on its location between splittables function SplitStr$(split$, text$, loc) commacnt = 0 cnt = 1 dim retarray$(CountInStr(split$, text$)) temp$ = "" word$ = ""

while cnt <= len(text$) temp$ = mid$(text$, cnt, 1)

if mid$(text$, cnt, len(split$)) = split$ then retarray$(commacnt) = word$ word$ = "" commacnt = commacnt + 1 cnt = cnt + len(split$) else word$ = word$ + temp$ cnt = cnt + 1 end if wend

retarray$(commacnt) = word$

if (loc - 1) <= commacnt then SplitStr$ = retarray$(loc-1) else SplitStr$ = "" end if

end function code