我所写的程序中由于分成单字统计,将双字节汉字也分开了,不知如何合并成一个字。用asc判断,但是由于前后两个同样为重复值为63,分别向前取两字节时后一个将下一个非双字节汉字一起取出,很苦恼。
这个情况如何避免呢? 是重设if语句还是直接判断跳转到下一个记录,还是删除下一个记录?
谢谢!
下面是原程序:
Private Sub Command0_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim schar As String
Dim suni As String, dz As String
Dim i1 As Integer, I As Integer
Set db = CurrentDb()
Set rst = db.OpenRecordset("ju")
Set rst_qiefen = db.OpenRecordset("qiefen")
Do Until rst.EOF
schar = rst!sentence
For I = 1 To Len(schar)
dz= Mid(schar, I, 1 + i1)
If Asc(dz) = 63 Then
i1 = 1
dz = Mid(schar, I, 1 + i1)
With rst_qiefen
.AddNew
!uni = suni
!danzi = dz
.Update
End With
Else
i1 = 0
dz = Mid(schar, I, 1 + i1)
With rst_qiefen
.AddNew
!uni = suni
!danzi = dz
.Update
End With
End If
End If
Next I
rst.MoveNext
Loop
End Sub
[此贴子已经被作者于2005-8-31 12:48:09编辑过]
|