f_char_find_dec_workprice.srf 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. $PBExportHeader$f_char_find_dec_workprice.srf
  2. global type f_char_find_dec_workprice from function_object
  3. end type
  4. forward prototypes
  5. global function decimal f_char_find_dec_workprice (string arg_computstr, string arg_findstr)
  6. end prototypes
  7. global function decimal f_char_find_dec_workprice (string arg_computstr, string arg_findstr);long ll_pos
  8. decimal ld_dec_return
  9. long ll_len,ll_i,ll_asc
  10. String ls_dec_tmp,ls_char_tmp
  11. ld_dec_return = 0
  12. ll_pos = posA(arg_computstr,arg_findstr)
  13. if ll_pos = 0 then goto ext
  14. ll_len = lenA(arg_computstr)
  15. for ll_i = ll_pos + 1 to ll_len
  16. ls_char_tmp = midA(arg_computstr,ll_i,1)
  17. ll_asc = Asc(ls_char_tmp)
  18. If ll_asc >= 48 And ll_asc <= 57 Then
  19. //0~9
  20. ls_dec_tmp = ls_dec_tmp + ls_char_tmp
  21. If ll_i < ll_len Then
  22. Continue
  23. End If
  24. ElseIf ll_asc = 46 Then
  25. //asc 46 = '.'
  26. If Trim(ls_dec_tmp) = '' Then
  27. If ll_i < ll_len Then
  28. Continue
  29. End If
  30. Else
  31. ls_dec_tmp = ls_dec_tmp + ls_char_tmp
  32. If ll_i < ll_len Then
  33. Continue
  34. End If
  35. End If
  36. End If
  37. ld_dec_return = Dec(ls_dec_tmp)
  38. exit
  39. next
  40. ext:
  41. return ld_dec_return
  42. end function