1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- $PBExportHeader$f_char_find_dec_workprice.srf
- global type f_char_find_dec_workprice from function_object
- end type
- forward prototypes
- global function decimal f_char_find_dec_workprice (string arg_computstr, string arg_findstr)
- end prototypes
- global function decimal f_char_find_dec_workprice (string arg_computstr, string arg_findstr);long ll_pos
- decimal ld_dec_return
- long ll_len,ll_i,ll_asc
- String ls_dec_tmp,ls_char_tmp
- ld_dec_return = 0
- ll_pos = posA(arg_computstr,arg_findstr)
- if ll_pos = 0 then goto ext
- ll_len = lenA(arg_computstr)
- for ll_i = ll_pos + 1 to ll_len
- ls_char_tmp = midA(arg_computstr,ll_i,1)
-
- ll_asc = Asc(ls_char_tmp)
- If ll_asc >= 48 And ll_asc <= 57 Then
- //0~9
- ls_dec_tmp = ls_dec_tmp + ls_char_tmp
-
- If ll_i < ll_len Then
- Continue
- End If
- ElseIf ll_asc = 46 Then
- //asc 46 = '.'
- If Trim(ls_dec_tmp) = '' Then
- If ll_i < ll_len Then
- Continue
- End If
- Else
- ls_dec_tmp = ls_dec_tmp + ls_char_tmp
- If ll_i < ll_len Then
- Continue
- End If
- End If
- End If
- ld_dec_return = Dec(ls_dec_tmp)
- exit
- next
- ext:
- return ld_dec_return
- end function
|