05-20-2011, 03:55 AM
Check the following code. In this code total number of elements are 20. When the string is tokenized, number of tokens & array length is returned 17 However on displaying values of array count is 20. Why is this difference. Please clarify. I need number of tokens, array length to be 20 only.
lpstr a=
;IGL,100,345.2,310,311
;ORIENTBANK,1,349.5,301,300
;IGL,100,345.2,310,311
;ORIENTBANK,1,349.5,301,300
ARRAY(str) arr
int nt=tok(a arr -1 ",")
out nt
out arr.len
for nt 0 arr.len
,out arr[nt]
lpstr a=
;IGL,100,345.2,310,311
;ORIENTBANK,1,349.5,301,300
;IGL,100,345.2,310,311
;ORIENTBANK,1,349.5,301,300
ARRAY(str) arr
int nt=tok(a arr -1 ",")
out nt
out arr.len
for nt 0 arr.len
,out arr[nt]