当前位置:编程学习 > VB >>

vb

那位高手谁能帮我修改下该程序呀。我不知道怎么修改哦,谢谢啦哈
Private Sub Command1_Click()

If IsNull(Me.Text1) Then
End
Else
Call yuan
Label1.Caption = Label1.Caption + yuan
End If
End Sub



Public Function yuan(tao As String) As String
If Asc(tao) < 0 Then
If Asc(Left(tao, 1)) < Asc("啊") Then
yuan = "0"
  'asc函数是将字符转换成ascII
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("啊") And Asc(Left(tao, 1)) < Asc("吧") Then
yuan = "a"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("吧") And Asc(Left(tao, 1)) < Asc("才") Then
yuan = "b"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("才") And Asc(Left(tao, 1)) < Asc("到") Then
yuan = "c"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("到") And Asc(Left(tao, 1)) < Asc("额") Then
yuan = "d"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("额") And Asc(Left(tao, 1)) < Asc("发") Then
yuan = "e"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("发") And Asc(Left(tao, 1)) < Asc("高") Then
yuan = "f"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("高") And Asc(Left(tao, 1)) < Asc("哈") Then
yuan = "g"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("哈") And Asc(Left(tao, 1)) < Asc("鸡") Then
yuan = "h"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("鸡") And Asc(Left(tao, 1)) < Asc("看") Then
yuan = "j"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("看") And Asc(Left(tao, 1)) < Asc("拉") Then
yuan = "k"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("拉") And Asc(Left(tao, 1)) < Asc("妈") Then
yuan = "l"
Exit Function
End If


If Asc(Left(tao, 1)) >= Asc("妈") And Asc(Left(tao, 1)) < Asc("那") Then
yuan = "m"
Exit Function
End If


If Asc(Left(tao, 1)) >= Asc("那") And Asc(Left(tao, 1)) < Asc("哦") Then
yuan = "n"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("哦") And Asc(Left(tao, 1)) < Asc("普") Then
yuan = "o"
Exit Function
End If


If Asc(Left(tao, 1)) >= Asc("普") And Asc(Left(tao, 1)) < Asc("期") Then
yuan = "p"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("期") And Asc(Left(tao, 1)) < Asc("然") Then
yuan = "q"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("然") And Asc(Left(tao, 1)) < Asc("撒 ") Then
yuan = "r"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("撒") And Asc(Left(tao, 1)) < Asc("套") Then
yuan = "s"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("套") And Asc(Left(tao, 1)) < Asc("挖") Then
yuan = "t"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("挖") And Asc(Left(tao, 1)) < Asc("系") Then
yuan = "w"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("系") And Asc(Left(tao, 1)) < Asc("有") Then
yuan = "x"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("有") And Asc(Left(tao, 1)) < Asc("找") Then
yuan = "y"
Exit Function
End If

If Asc(Left(tao, 1)) >= Asc("找") Then
yuan = "z"
Exit Function
End If

Else
If UCase(tao) <= "Z" And UCase(tao) >= "A" Then 'ucase小写字母转换成大写字母
yuan = UCase(Left(tao, 1))
Else
tao = yuan
End If
End If

End Function
程序已一运行系统一直会出现编译错误,必选参数提示。请各位高手帮我看看这段代码。请帮我修改下。程序主要是想得到汉字的首个拼音自动查询出需要输入的汉字信息 
--------------------编程问答-------------------- 好像问过?
IsNull(Me.Text1) --------------------编程问答-------------------- 等待高人
补充:VB ,  基础类
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,