设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

12下一页
返回列表 发新帖
查看: 2074|回复: 13
打印 上一主题 下一主题

[其它] tmtony 支持拼音首字母的组合框函数及实例,有点小问题。

[复制链接]
跳转到指定楼层
1#
发表于 2006-1-2 19:11:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
对“属”字好像判断不正确。大家试试。

DEBUG.Print HZ2PY("金属")
jz
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏1 分享分享 分享淘帖 订阅订阅
2#
发表于 2006-1-3 05:29:00 | 只看该作者
希望你能到原发贴的主题中发贴,以便能使例子更完善
3#
发表于 2006-1-3 05:51:00 | 只看该作者


这个拼音函数较完整:

Public Function HZQP(expression As String, Optional delimiter As String = " ", Optional limit As Integer = -1) As String

'expression
'     必需的?包含要转换的字符串?
'delimiter
'     可选的。用于标识分隔拼音的字符串字符。如果忽略,则使用空格字符(" ")作为分隔符。如果delimiter是一个长度为零的字符串,则返回仅包含一个元素,即完整的 expression字符串。
'limit
'     可选的。要返回拼音字符数,–1表示返回所有的拼音字符数,1表示返回拼音首字母。


Dim STR As String, arrWord(400) As String
Dim I As Integer, J As Integer
arrWord(1) = "吖a"
arrWord(2) = "哎ai"
arrWord(3) = "腤an"
arrWord(4) = "肮ang"
arrWord(5) = "凹ao"
arrWord(6) = "八ba"
arrWord(7) = "挀bai"
arrWord(8) = "扳ban"
arrWord(9) = "邦bang"
arrWord(10) = "勹bao"
arrWord(11) = "陂bei"
arrWord(12) = "奔ben"
arrWord(13) = "崩beng"
arrWord(14) = "皀bi"
arrWord(15) = "边bian"
arrWord(16) = "杓biao"
arrWord(17) = "憋bie"
arrWord(18) = "邠bin"
arrWord(19) = "仌bing"
arrWord(20) = "拨bo"
arrWord(21) = "峬bu"
arrWord(22) = "嚓ca"
arrWord(23) = "猜cai"
arrWord(24) = "飡can"
arrWord(25) = "仓cang"
arrWord(26) = "撡cao"
arrWord(27) = "冊ce"
arrWord(28) = "嵾cen"
arrWord(29) = "噌ceng"
arrWord(30) = "叉cha"
arrWord(31) = "拆chai"
arrWord(32) = "辿chan"
arrWord(33) = "伥chang"
arrWord(34) = "抄chao"
arrWord(35) = "车che"
arrWord(36) = "抻chen"
arrWord(37) = "阷cheng"
arrWord(38) = "吃chi"
arrWord(39) = "充chong"
arrWord(40) = "抽chou"
arrWord(41) = "出chu"
arrWord(42) = "搋chuai"
arrWord(43) = "巛chuan"
arrWord(44) = "刅chuang"
arrWord(45) = "吹chui"
arrWord(46) = "旾chun"
arrWord(47) = "踔chuo"
arrWord(48) = "呲ci"
arrWord(49) = "从cong"
arrWord(50) = "凑cou"
arrWord(51) = "粗cu"
arrWord(52) = "汆cuan"
arrWord(53) = "崔cui"
arrWord(54) = "邨cun"
arrWord(55) = "搓cuo"
arrWord(56) = "咑da"
arrWord(57) = "呆dai"
arrWord(58) = "丹dan"
arrWord(59) = "当dang"
arrWord(60) = "刀dao"
arrWord(61) = "恴de"
arrWord(62) = "灯deng"
arrWord(63) = "仾di"
arrWord(64) = "敁dian"
arrWord(65) = "刁diao"
arrWord(66) = "爹die"
arrWord(67) = "丁ding"
arrWord(68) = "丟diu"
arrWord(69) = "东dong"
arrWord(70) = "剅dou"
arrWord(71) = "嘟du"
arrWord(72) = "耑duan"
arrWord(73) = "垖dui"
arrWord(74) = "吨dun"
arrWord(75) = "多duo"
arrWord(76) = "妸e"
arrWord(77) = "奀en"
arrWord(78) = "儿er"
arrWord(79) = "发fa"
arrWord(80) = "帆fan"
arrWord(81) = "方fang"
arrWord(82) = "飞fei"
arrWord(83) = "分fen"
arrWord(84) = "丰feng"
arrWord(85) = "仏fo"
arrWord(86) = "紑fou"
arrWord(87) = "夫fu"
arrWord(88) = "旮ga"
arrWord(89) = "该gai"
arrWord(90) = "干gan"
arrWord(91) = "冈gang"
arrWord(92) = "皋gao"
arrWord(93) = "戈ge"
arrWord(94) = "给gei"
arrWord(95) = "根gen"
arrWord(96) = "更geng"
arrWord(97) = "工gong"
arrWord(98) = "勾gou"
arrWord(99) = "估gu"
arrWord(100) = "瓜gua"
arrWord(101) = "乖guai"
arrWord(102) = "关guan"
arrWord(103) = "光guang"
arrWord(104) = "归gui"
arrWord(105) = "衮gun"
arrWord(106) = "呙guo"
arrWord(107) = "铪ha"
arrWord(108) = "嗨hai"
arrWord(109) = "佄han"
arrWord(110) = "夯hang"
arrWord(111) = "蒿hao"
arrWord(112) = "诃he"
arrWord(113) = "黒hei"
arrWord(114) = "拫hen"
arrWord(115) = "亨heng"
arrWord(116) = "叿hong"
arrWord(117) = "侯hou"
arrWord(118) = "乎hu"
arrWord(119) = "花hua"
arrWord(120) = "怀huai"
arrWord(121) = "欢huan"
arrWord(122) = "巟huang"
arrWord(123) = "灰hui"
arrWord(124) = "昏hun"
arrWord(125) = "吙huo"
arrWord(126) = "丌ji"
arrWord(127) = "加jia"
arrWord(128) = "戋jian"
arrWord(129) = "江jiang"
arrWord(130) = "艽jiao"
arrWord(131) = "阶jie"
arrWord(132) = "巾jin"
arrWord(133) = "坕jing"
arrWord(134) = "冂jiong"
arrWord(135) = "丩jiu"
arrWord(136) = "凥ju"
arrWord(137) = "姢juan"
arrWord(138) = "噘jue"
4#
发表于 2006-1-4 03:03:00 | 只看该作者
fan0217版主的方法,让我又多学了一招。

但有个问题:

不支持汉字拼音首字母的模糊查询。

5#
发表于 2006-1-4 03:04:00 | 只看该作者
fan0217版主的方法,让我又多学了一招。

但有个问题:

不支持汉字拼音首字母的模糊查询。


tmtony的却 支持拼音首字母的查询。



[此贴子已经被作者于2006-1-3 19:06:16编辑过]

6#
 楼主| 发表于 2006-1-4 16:06:00 | 只看该作者
以下是引用一点通在2006-1-2 21:29:00的发言:
希望你能到原发贴的主题中发贴,以便能使例子更完善

在原来发贴的地方也发过了。
7#
 楼主| 发表于 2006-1-4 16:27:00 | 只看该作者
以下是引用yttzm在2006-1-3 19:04:00的发言:


fan0217版主的方法,让我又多学了一招。

但有个问题:

不支持汉字拼音首字母的模糊查询。


tmtony的却 支持拼音首字母的查询。






这个函数也有问题。

debug.Print hzqp("金属")
jin zhu
8#
 楼主| 发表于 2006-1-4 16:30:00 | 只看该作者


将函数修改一下,

Optional delimiter As String = ""

也支持拼音首字母的缩写查询,但也有问题。

debug.Print hzqp("金属","",1)
jz


[此贴子已经被作者于2006-1-4 8:31:54编辑过]

9#
发表于 2006-1-4 21:56:00 | 只看该作者
以下是引用yttzm在2006-1-3 19:03:00的发言:


fan0217版主的方法,让我又多学了一招。

但有个问题:

不支持汉字拼音首字母的模糊查询。

声明这不是我的作品,是李寻欢在http://www.accfans.net/index.htm发表的,我可弄不来这么复杂的东东。
10#
 楼主| 发表于 2006-1-11 16:18:00 | 只看该作者
谁能解决这个问题?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-11-18 10:42 , Processed in 0.082566 second(s), 34 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表