//本来想在网上找个现成的函数来着,但是找了好长时间也没找到,没办法,自己研究着写了一个,记载一下.
long ll_point,ll_hex,ll_len
ulong ll_value
string ls_pv
string fs_hex
string ls_str,ls_str_mid,ls_str_mid1
string ls_value
long ll_str,i
ls_str = as_str //'\u540c\u6b65\u6210\u529f' as_mid = '\'
ll_str = len(ls_str)
ls_str_mid1 = ls_str
do while pos(ls_str_mid1,as_mid,1) > 0
ll_value = 0
ls_str_mid = mid(ls_str_mid1,1,pos(ls_str_mid1,as_mid,2) -1)
if ls_str_mid = '' then
ls_str_mid = ls_str_mid1
end if
ls_str_mid1 = mid(ls_str_mid1,pos(ls_str_mid1,as_mid,2) ,len(ls_str))
// messagebox('str1',ls_str_mid1)
// messagebox('str',ls_str_mid)
ll_len = len(ls_str_mid)
for ll_point = ll_len to 1 step -1
ls_pv = mid(ls_str_mid,ll_point,1)
choose case ls_pv
case 'a','A'
ll_hex = 10
case 'b','B'
ll_hex = 11
case 'c','C'
ll_hex = 12
case 'd','D'
ll_hex = 13
case 'e','E'
ll_hex = 14
case 'f','F'
ll_hex = 15
case else
ll_hex = long(ls_pv)
end choose
ll_value = ll_value + ll_hex * 16 ^ (ll_len - ll_point )
next
if ls_str_mid = ls_str_mid1 then ls_str_mid1 = ''
ls_value = ls_value + string(char(ll_value))
loop
as_value = ls_value
//messagebox('',ls_value)
return ll_value