请问各位高手

yaneping 2003-12-13 03:20:44
请问各位高手,我如何让输入的汉字自动能查询到它的拼音首字母呢?有代码就太好了!
...全文
57 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhangdatou 2003-12-18
  • 打赏
  • 举报
回复
去下载个例子吧
tongcheng 2003-12-17
  • 打赏
  • 举报
回复
up
TIGERWONG 2003-12-17
  • 打赏
  • 举报
回复
我也是用前辈的函数
mittee 2003-12-16
  • 打赏
  • 举报
回复
用前辈的函数即可
wwwafa9 2003-12-16
  • 打赏
  • 举报
回复
www.kejx.com上面有个例子可以下载的。
yanghongfeng 2003-12-13
  • 打赏
  • 举报
回复
楼上的吧,我也有DLL也可以,要就发E到yangjwy@163.com
hzhxxx 2003-12-13
  • 打赏
  • 举报
回复
up

楼上的 可以
lmby 2003-12-13
  • 打赏
  • 举报
回复
string ls_hz[], ls_py[], ls_pym, ls_char, ls_char2
int i, li_py, li_len

ls_hz[1] = "吖"
ls_hz[2] = "八"
ls_hz[3] = "擦"
ls_hz[4] = "达"
ls_hz[5] = "屙"
ls_hz[6] = "发"
ls_hz[7] = "旮"
ls_hz[8] = "哈"
ls_hz[9] = "讥"
ls_hz[10] = "咔"
ls_hz[11] = "垃"
ls_hz[12] = "呣"
ls_hz[13] = "拿"
ls_hz[14] = "噢"
ls_hz[15] = "趴"
ls_hz[16] = "七"
ls_hz[17] = "然"
ls_hz[18] = "仨"
ls_hz[19] = "他"
ls_hz[20] = "哇"
ls_hz[21] = "夕"
ls_hz[22] = "丫"
ls_hz[23] = "匝"

ls_py[1] = "A"
ls_py[2] = "B"
ls_py[3] = "C"
ls_py[4] = "D"
ls_py[5] = "E"
ls_py[6] = "F"
ls_py[7] = "G"
ls_py[8] = "H"
ls_py[9] = "J"
ls_py[10] = "K"
ls_py[11] = "L"
ls_py[12] = "M"
ls_py[13] = "N"
ls_py[14] = "O"
ls_py[15] = "P"
ls_py[16] = "Q"
ls_py[17] = "R"
ls_py[18] = "S"
ls_py[19] = "T"
ls_py[20] = "W"
ls_py[21] = "X"
ls_py[22] = "Y"
ls_py[23] = "Z"

//查找每个汉字在哪两个界限以内,由此确定其拼音码
li_len = len( as_text )

for i = 1 to li_len
if asc( mid( as_text, i, 1 ) ) < 128 then
ls_pym = ls_pym + mid( as_text, i, 1 )
else
ls_char = mid( as_text, i, 2 )
if ls_char < "吖" or ls_char > "做" then
ls_pym = ls_pym + mid( as_text , i, 2 )
i ++
continue
end if
li_py = 23
do while ls_hz[li_py] > ls_char
li_py --
loop
ls_pym = ls_pym + ls_py[li_py]
i ++
end if
next

return lower( ls_pym )
eminena 2003-12-13
  • 打赏
  • 举报
回复
用一个表来存储 汉字 及其 全拼.

396

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 非技术版
社区管理员
  • 非技术版社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧