s="one,two,three,four,five,six,"
'mark string into null strings
'=============================
'replace commas with nulls
'creates series of zstrings
c=0
i=1
le=len s
byte *b : @b=strptr s
do
if i>le then exit do
if b=44 then
b=0 'patch null
c++
end if
i++
@b++
end do
'create array of zstring pointers
'================================
sys pz[100]
ps=strptr(s)-1
nl=chr(0)
j=1
i=0
do
i++
if i>c then exit do
pz[ i ]=ps+j
j=1+instr j,s,nl
end do
c=i-1
'display
'=======
cr=chr(13)+chr(10)
tab=chr(9)
pr="sub strings" cr cr
for i=1 to c
pr+=i tab cast char * pz[ i ] cr
next
print pr