12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- $PBExportHeader$uo_string_helper.sru
- forward
- global type uo_string_helper from nonvisualobject
- end type
- end forward
- global type uo_string_helper from nonvisualobject autoinstantiate
- end type
- type variables
- string ins_string
- end variables
- forward prototypes
- public subroutine uf_split (string arg_spliter, ref string arg_rslt[])
- public subroutine uf_replace (string arg_parm, string arg_value)
- public function string uf_getfunname (string arg_funname)
- end prototypes
- public subroutine uf_split (string arg_spliter, ref string arg_rslt[]);long ll_start = 1
- long ll_pos
- long ll_cnt = 0
- string ls_rslt[]
- ll_pos = pos(ins_string, arg_spliter, ll_start)
- do while ll_pos > 0
- ll_cnt++
- ls_rslt[ll_cnt] = mid(ins_string, ll_start, ll_pos - ll_start)
- ll_start = ll_pos + len(arg_spliter)
- ll_pos = pos(ins_string, arg_spliter, ll_start)
- loop
- ll_cnt ++
- ls_rslt[ll_cnt] = mid(ins_string, ll_start)
- arg_rslt = ls_rslt
- end subroutine
- public subroutine uf_replace (string arg_parm, string arg_value);long ll_pos = 1, ll_find
- ll_find = pos(ins_string, arg_parm, ll_pos)
- do while ll_find > 0
- ins_string = Replace(ins_string, ll_find, len(arg_parm), arg_value)
- ll_pos = ll_find + len(arg_value)
- ll_find = pos(ins_string, arg_parm, ll_pos)
- loop
- end subroutine
- public function string uf_getfunname (string arg_funname);long ll_pos
- ll_pos = pos(ins_string, arg_funname)
- if ll_pos <= 0 then
- return arg_funname
- end if
- ll_pos = pos(ins_string, arg_funname, ll_pos + len(arg_funname))
- if ll_pos <= 0 then
- return arg_funname
- end if
- long ll_p2
- ll_p2 = pos(ins_string, ')', ll_pos)
- if ll_p2 <= 0 then
- return arg_funname
- end if
- return mid(ins_string, ll_pos, ll_p2 - ll_pos + 1)
- end function
- on uo_string_helper.create
- call super::create
- TriggerEvent( this, "constructor" )
- end on
- on uo_string_helper.destroy
- TriggerEvent( this, "destructor" )
- call super::destroy
- end on
|