123456789101112131415161718192021222324 |
- $PBExportHeader$f_str_split.srf
- global type f_str_split from function_object
- end type
- forward prototypes
- global subroutine f_str_split (string arg_str, string arg_spliter, ref string arg_rslt[])
- end prototypes
- global subroutine f_str_split (string arg_str, string arg_spliter, ref string arg_rslt[]);long ll_start = 1
- long ll_pos
- long ll_cnt = 0
- string ls_rslt[]
- ll_pos = pos(arg_str, arg_spliter, ll_start)
- do while ll_pos > 0
- ll_cnt++
- ls_rslt[ll_cnt] = mid(arg_str, ll_start, ll_pos - ll_start)
- ll_start = ll_pos + len(arg_spliter)
- ll_pos = pos(arg_str, arg_spliter, ll_start)
- loop
- ll_cnt ++
- ls_rslt[ll_cnt] = mid(arg_str, ll_start)
- arg_rslt = ls_rslt
- end subroutine
|