clear cstr="abc32skfkj262ksf8k99kfsk24kf" cstr1="" ncount=0 nsum=0 ok=.f. for i=1 to len(cstr) a=substr(cstr,i,1) if isdigit(a)=.t. cstr1=cstr1+a ok=.t. else if ok=.t. nsum=nsum+val(cstr1) cstr1="" ok=.f. ncount=ncount+1 endif endif endfor ?"平均值=",nsum/ncount