ASP common functions: Getpy () _ Application techniques
Source: Internet
Author: User
<%
' Take field data ' Pinyin first letter of each Chinese character
Function Getpychar (char)
TMP = 65536 + ASC (char)
If (tmp>= 45217 and tmp<= 45252) Then
Getpychar = "A"
ElseIf (tmp>= 45253 and tmp<= 45760) Then
Getpychar = "B"
ElseIf (tmp>= 47761 and tmp<= 46317) Then
Getpychar = "C"
ElseIf (tmp>= 46318 and tmp<= 46825) Then
Getpychar = "D"
ElseIf (tmp>= 46826 and tmp<= 47009) Then
Getpychar = "E"
ElseIf (tmp>= 47010 and tmp<= 47296) Then
Getpychar = "F"
ElseIf (tmp>= 47297 and tmp<= 47613) Then
Getpychar = "G"
ElseIf (tmp>= 47614 and tmp<= 48118) Then
Getpychar = "H"
ElseIf (tmp>= 48119 and tmp<= 49061) Then
Getpychar = "J"
ElseIf (tmp>= 49062 and tmp<= 49323) Then
Getpychar = "K"
ElseIf (tmp>= 49324 and tmp<= 49895) Then
Getpychar = "L"
ElseIf (tmp>= 49896 and tmp<= 50370) Then
Getpychar = "M"
ElseIf (tmp>= 50371 and tmp<= 50613) Then
Getpychar = "N"
ElseIf (tmp>= 50614 and tmp<= 50621) Then
Getpychar = "O"
ElseIf (tmp>= 50622 and tmp<= 50905) Then
Getpychar = "P"
ElseIf (tmp>= 50906 and tmp<= 51386) Then
Getpychar = "Q"
ElseIf (tmp>= 51387 and tmp<= 51445) Then
Getpychar = "R"
ElseIf (tmp>= 51446 and tmp<= 52217) Then
Getpychar = "S"
ElseIf (tmp>= 52218 and tmp<= 52697) Then
Getpychar = "T"
ElseIf (tmp>= 52698 and tmp<= 52979) Then
Getpychar = "W"
ElseIf (tmp>= 52980 and tmp<= 53640) Then
Getpychar = "X"
ElseIf (tmp>= 53689 and tmp<= 54480) Then
Getpychar = "Y"
ElseIf (tmp>= 54481 and tmp<= 62289) Then
Getpychar = "Z"
Else ' If it is not Chinese, it is not processed
Getpychar = Char
End If
End Function
Function getpy (STR)
For i = 1 to Len (STR)
Getpy = Getpy&getpychar (Mid (STR, I, 1))
Next
End Function
%>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.