'*****************字符累乘器函数**************************
My_Str="SALEKING"
Function Str_Imul(My_Str As String) As Long
Dim i As Integer
Dim l As Integer
Dim D As Long
D = 1
l = Len(My_Str)
For i = 1 To l
D = D * Asc(Mid(My_Str, i, 1))
Next
Str_Imul = D
End Function
**********************************************************
Function multi(ByVal X As String, ByVal Y As String) As String ''multi of two huge hexnum(两个大数之积)
Dim result As Variant
Dim xl As Long, yl As Long, temp As Long, i As Long
xl = Len(Trim(X))
yl = Len(Trim(Y))
ReDim result(1 To xl + yl)
For i = 1 To xl
For temp = 1 To yl
result(i + temp) = result(i + temp) + Val(Mid(X, i, 1)) * Val(Mid(Y, temp, 1))
Next
Next
For i = xl + yl To 2 Step -1
temp = result(i) \ 10
result(i) = result(i) Mod 10
result(i - 1) = result(i - 1) + temp
Next
If result(1) = "0" Then result(1) = ""
multi = Join(result, "")
Erase result
My_Str="SALEKING"
Function Str_Imul(My_Str As String) As Currency
Dim i As Integer
Dim l As Integer
Dim D As Currency
D = 1
l = Len(My_Str)
For i = 1 To l
D = D * Asc(Mid(My_Str, i, 1))
Next
Str_Imul = D
End Function