a$="xi1 ri4 you3 ge4 san1 da4 xian2 ," wordCount=0 @GetWords (a$,wordCount) procedure GetWords (a$,wordCount) c=0; tem$=a$; temp$=a$; #c is used to hold the number of words in the current line; #wordCount holds the total number of words so far divo=1; while divo!=0 divo=index_regex(temp$,"\d") printline div='div' if divo!=0 leng=length(temp$) temp$=right$(temp$,'leng'-'divo'-1) c+=1; endif endwhile #c is he number of total words in this sentence line printline there are 'c' words in this line for wi from wordCount to wordCount+c-1 divo=index_regex(tem$,"\d") printline div='divo' word$ [wi] = left$(tem$, 'divo') len=length(tem$) tem$=right$ (tem$, 'len'-'divo'-1) endfor for wj from wordCount to wordCount+c-1 appendInfoLine("the word is ", word$[wj]) endfor wordCount=wordCount+c; endproc