奇怪 IF循环莫名其妙停止了
Private Sub Command2_Click()Dim a As String, b As String, c As String, x As String
x = Text1.Text
a = Text2.Text
Open App.Path & "\1.txt" For Append As #1
If Check1.Value = 1 Then
b = a
c = Mid(b, 5, 2)
b = Replace(b, c, "-1")
x = Replace(x, a, b)
Print #1, x
Text3.Text = x
End If
If Check2.Value = 1 Then
b = a
c = Mid(b, 5, 2)
b = Replace(b, c, "-2")
x = Replace(x, a, b)
Print #1, x
Text3.Text = x
End If
If Check3.Value = 1 Then
b = a
c = Mid(b, 5, 2)
b = Replace(b, c, "-3")
x = Replace(x, a, b)
Print #1, x
Text3.Text = x
End If
Close #1
End Sub
Text1.Text=A5000-55A
Text2.Text=5000-55
选中 Check1 运行结果 Text3.Text=A5000-15A
选中 Check2 运行结果 Text3.Text=A5000-25A
选中 Check3 运行结果 Text3.Text=A5000-35A
全选 则 Text3.Text=A5000-15A
文本输入了3次 A5000-15A 值,而不是A5000-15A A5000-25A A5000-35A 搞不懂怎么回事
[ 本帖最后由 woa 于 2010-9-8 23:20 编辑 ]