f_str_replace.srf 554 B

123456789101112131415161718
  1. $PBExportHeader$f_str_replace.srf
  2. global type f_str_replace from function_object
  3. end type
  4. forward prototypes
  5. global subroutine f_str_replace (ref string arg_str, string arg_parm, string arg_value)
  6. end prototypes
  7. global subroutine f_str_replace (ref string arg_str, string arg_parm, string arg_value);long ll_pos = 1, ll_find
  8. ll_find = pos(arg_str, arg_parm, ll_pos)
  9. do while ll_find > 0
  10. arg_str = Replace(arg_str, ll_find, len(arg_parm), arg_value)
  11. ll_pos = ll_find + len(arg_value)
  12. ll_find = pos(arg_str, arg_parm, ll_pos)
  13. loop
  14. end subroutine