f_atab.srf 588 B

1234567891011121314151617181920212223242526
  1. $PBExportHeader$f_atab.srf
  2. $PBExportComments$Tab分隔的字符串分解为数组--函数
  3. global type f_atab from function_object
  4. end type
  5. forward prototypes
  6. global function long f_atab (ref string aa[], string as)
  7. end prototypes
  8. global function long f_atab (ref string aa[], string as);int lj,li
  9. string lsl='~t',ls
  10. if as>'' and right(as,1)<>'~t' then as=as+'~t'
  11. do while true
  12. lj=pos(as,'~t')//tab
  13. if lj=0 then exit
  14. ls=trim(left(as,lj -1))
  15. as=mid(as,lj+1)
  16. if pos(lsl,'~t'+ls+'~t')>0 then continue//有重名情况
  17. li++
  18. aa[li]=ls
  19. lsl=lsl+ls+'~t'
  20. loop
  21. return li
  22. end function