uo_strhelper.sru 966 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. $PBExportHeader$uo_strhelper.sru
  2. forward
  3. global type uo_strhelper from nonvisualobject
  4. end type
  5. end forward
  6. global type uo_strhelper from nonvisualobject
  7. end type
  8. global uo_strhelper uo_strhelper
  9. forward prototypes
  10. public subroutine split (string arg_source, string arg_spliter, ref string arg_return[])
  11. end prototypes
  12. public subroutine split (string arg_source, string arg_spliter, ref string arg_return[]);string arg_rslt[]
  13. long ll_cnt = 0
  14. long ll_pos = 0
  15. do while len(arg_source) > 0
  16. ll_pos = pos(arg_source, arg_spliter)
  17. if ll_pos > 0 then
  18. ll_cnt++
  19. arg_rslt[ll_cnt] = mid(arg_source, 1, ll_pos - 1)
  20. arg_source = mid(arg_source, ll_pos + len(arg_spliter))
  21. else
  22. ll_cnt++
  23. arg_rslt[ll_cnt] = arg_source
  24. arg_source = ''
  25. end if
  26. loop
  27. arg_return = arg_rslt
  28. end subroutine
  29. on uo_strhelper.create
  30. call super::create
  31. TriggerEvent( this, "constructor" )
  32. end on
  33. on uo_strhelper.destroy
  34. TriggerEvent( this, "destructor" )
  35. call super::destroy
  36. end on