看板Programming
标 题Re: 请问VBA有可辨认中文的指令吗?
发信站SayYA 资讯站 (Sat Jun 24 13:18:26 2006)
转信站ptt!ctu-reader!news.nctu!SayYa
※ 引述《[email protected] (Jojoba)》之铭言:
> ※ 引述《[email protected] (理昌)》之铭言:
> > 简单的说... 是不可能...
> > 你可以用检测第一个byte是不是high ASCII来检查这是不是DBCS,
> ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
> 请问这是什麽样的指令?
> 我只会一些基本的指令,找了许多书也没看到这种东西
> > 没有可靠的检查方法.
> 虽然没有可靠的检查方法, 但我还想试试看你所说的方法,
> 先谢谢你的回答
由於VB不支援unsigned integer... 只好这样了...
Dim x As String
Dim y As Integer
x = "中"
y = Strings.Asc(x)
If (y < -1) And (y > &HA000) Then
MsgBox "This character has first byte in high ascii"
End If
也许其他人可以写得更好...
--
※ Origin: SayYA 资讯站 <bbs.sayya.org>
◆ From: static-ip-84-126-134-202.rev.dyxnet.com