手机
当前位置:查字典教程网 >编程开发 >ASP教程 >ASP常用函数:getpy()
ASP常用函数:getpy()
摘要:

<%

'取字段数据每个汉字的拼音首字母

Functiongetpychar(char)

tmp=65536+Asc(char)

If(tmp>=45217Andtmp<=45252)Then

getpychar="A"

ElseIf(tmp>=45253Andtmp<=45760)Then

getpychar="B"

ElseIf(tmp>=47761Andtmp<=46317)Then

getpychar="C"

ElseIf(tmp>=46318Andtmp<=46825)Then

getpychar="D"

ElseIf(tmp>=46826Andtmp<=47009)Then

getpychar="E"

ElseIf(tmp>=47010Andtmp<=47296)Then

getpychar="F"

ElseIf(tmp>=47297Andtmp<=47613)Then

getpychar="G"

ElseIf(tmp>=47614Andtmp<=48118)Then

getpychar="H"

ElseIf(tmp>=48119Andtmp<=49061)Then

getpychar="J"

ElseIf(tmp>=49062Andtmp<=49323)Then

getpychar="K"

ElseIf(tmp>=49324Andtmp<=49895)Then

getpychar="L"

ElseIf(tmp>=49896Andtmp<=50370)Then

getpychar="M"

ElseIf(tmp>=50371Andtmp<=50613)Then

getpychar="N"

ElseIf(tmp>=50614Andtmp<=50621)Then

getpychar="O"

ElseIf(tmp>=50622Andtmp<=50905)Then

getpychar="P"

ElseIf(tmp>=50906Andtmp<=51386)Then

getpychar="Q"

ElseIf(tmp>=51387Andtmp<=51445)Then

getpychar="R"

ElseIf(tmp>=51446Andtmp<=52217)Then

getpychar="S"

ElseIf(tmp>=52218Andtmp<=52697)Then

getpychar="T"

ElseIf(tmp>=52698Andtmp<=52979)Then

getpychar="W"

ElseIf(tmp>=52980Andtmp<=53640)Then

getpychar="X"

ElseIf(tmp>=53689Andtmp<=54480)Then

getpychar="Y"

ElseIf(tmp>=54481Andtmp<=62289)Then

getpychar="Z"

Else'如果不是中文,则不处理

getpychar=char

EndIf

EndFunction

Functiongetpy(Str)

Fori=1ToLen(Str)

getpy=getpy&getpychar(Mid(Str,i,1))

Next

EndFunction

%>

【ASP常用函数:getpy()】相关文章:

asp 中常用的文件处理函数

ASP函数大全

ASP常用函数:Trace()

ASP 非法字符过滤函数

asp最常用的分页函数

小偷,采集程序常用函数

ASP常用函数:CheckBoxScript()

在ASP编程中使用数组

ASP中的EVAL函数使用教程

ASP常用函数:XMLEncode

精品推荐
分类导航