| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 668 人关注过本帖
标题:[转帖]将汉字转换为对应拼音头字母
只看楼主 加入收藏
盖茨他爹
Rank: 6Rank: 6
等 级:贵宾
威 望:28
帖 子:5255
专家分:0
注 册:2005-5-3
收藏
 问题点数:0 回复次数:0 
[转帖]将汉字转换为对应拼音头字母
正在做的一套程序中需要一个字母索引,就写了这么个函数,需要的可以参考一下,可能有BUG,没仔细测试(不是太重要的时候用,嘿嘿)
function htop(hz) dim tmp if asc(hz) > 0 then htop = hz else tmp = asc(hz) If tmp >= -20319 And tmp <= -20284 Then htop = "A" End If If tmp >= -20283 And tmp <= -19776 Then htop = "B" End If If tmp >= -19775 And tmp <= -19219 Then htop = "C" End If If tmp >= -19218 And tmp <= -18711 Then htop = "D" End If If tmp >= -18710 And tmp <= -18527 Then htop = "E" End If If tmp >= -18526 And tmp <= -18240 Then htop = "F" End If If tmp >= -18239 And tmp <= -17923 Then htop = "G" End If If tmp >= -17922 And tmp <= -17418 Then htop = "H" End If If tmp >= -17417 And tmp <= -16475 Then htop = "J" End If If tmp >= -16474 And tmp <= -16213 Then htop = "K" End If If tmp >= -16212 And tmp <= -15641 Then htop = "L" End If If tmp >= -15640 And tmp <= -15166 Then htop = "M" End If If tmp >= -15165 And tmp <= -14923 Then htop = "N" End If If tmp >= -14922 And tmp <= -14915 Then htop = "O" End If If tmp >= -14914 And tmp <= -14631 Then htop = "P" End If If tmp >= -14630 And tmp <= -14150 Then htop = "Q" End If If tmp >= -14149 And tmp <= -14091 Then htop = "R" End If If tmp >= -14090 And tmp <= -13319 Then htop = "S" End If If tmp >= -13318 And tmp <= -12839 Then htop = "T" End If If tmp >= -12838 And tmp <= -12557 Then htop = "W" End If If tmp >= -12556 And tmp <= -11848 Then htop = "X" End If If tmp >= -11847 And tmp <= -11056 Then htop = "Y" End If If tmp >= -11055 And tmp <= -10247 Then htop = "Z" End If End If end function
我想函数怎么用应该不用我说了吧
搜索更多相关主题的帖子: 拼音 汉字 字母 转帖 
2005-10-19 08:48
快速回复:[转帖]将汉字转换为对应拼音头字母
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028436 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved