Re: Constructing sequences
Sorry, an old version of my function got there. Here it is hopefully OK:
function mySplit(string s_input, object o_limiter)
sequence l_return, s_return, s_limiter, s_tail
integer n_start, n_stop
if atom(o_limiter) then
s_limiter = {o_limiter}
else
s_limiter = o_limiter
end if
l_return = {}
n_start = 1
s_tail = s_input
while TRUE do
n_stop = match(s_limiter, s_tail)
if n_stop then
s_return = s_tail[n_start..n_stop-1]
l_return = append(l_return, s_return)
s_tail = s_tail[n_stop + length(s_limiter)..$]
else
if length(s_tail) > 1 then
l_return = append(l_return, s_tail[n_start..$-1])
end if
exit
end if
end while
return l_return
end function
|
Not Categorized, Please Help
|
|