f_pb_split.srf 661 B

123456789101112131415161718192021222324252627
  1. $PBExportHeader$f_pb_split.srf
  2. global type f_pb_split from function_object
  3. end type
  4. forward prototypes
  5. global function integer f_pb_split (string arg_source, string arg_symbol, ref string arg_returnstr[])
  6. end prototypes
  7. global function integer f_pb_split (string arg_source, string arg_symbol, ref string arg_returnstr[]);
  8. string ls_cmd,ls_arg[]
  9. long i, li_argcnt = 1
  10. ls_cmd=trim(arg_source)
  11. DO WHILE Len(ls_cmd) > 0
  12. i = Pos( ls_cmd, arg_Symbol)
  13. IF i = 0 THEN i = Len(ls_cmd) + 1
  14. ls_arg[li_argcnt] = Left(ls_cmd, i - 1)
  15. li_argcnt = li_argcnt + 1
  16. ls_cmd = Replace(ls_cmd, 1, i, "")
  17. LOOP
  18. arg_returnstr=ls_arg
  19. return upperbound(ls_arg)
  20. end function