因为容错是少输一码情况下,仍为可唯一汉字时,才可以输出。。。但是可能有多少汉字存在此情形。。。所以,只能为其中一个汉字进行容错。。。所以必须bypass掉其它的汉字编码。。。
代码如下:
Dim BM As String, OldBM As String
Dim CI As String, OldCI As String
Open App.Path & "/3ma.txt" For Input As #1
Do While EOF(1) = False
Input #1, BM, CI
If BM = OldBM Then
Label3.Caption = "编码:" & BM & "已存在"
Else
Label3.Caption = "编码:" & BM & "可添加!"
Open App.Path & "/3ma_new.txt" For Append As #2
Print #2, BM; ","; CI
Close #2
End If
OldBM = BM
OldCI = CI
Loop
Close #1