下面的函数可以判断str1中是否含有半角,返回的是半角字符的个数.怎样将他变成等效的存储过程呢?
Function halfNUM1(ByVal str1) As Integer
    Dim pos     As Integer
    Dim strlen  As Integer
    Dim i       As Integer
    Dim str2    As String
    
    halfNUM1 = 0
    If str1 <> "" Then
        strlen = Len(str1)
        For i = 1 To strlen
            str2 = Mid(str1, i, 1)
            If Asc(str2) > 0 And str2 <> " " Then
                halfNUM1 = halfNUM1 + 1
            End If
        Next
    End If
End Function