| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 429 人关注过本帖
标题:奇怪 IF循环莫名其妙停止了
取消只看楼主 加入收藏
woa
Rank: 1
等 级:新手上路
帖 子:159
专家分:0
注 册:2008-12-4
结帖率:85.37%
收藏
已结贴  问题点数:20 回复次数:0 
奇怪 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 编辑 ]
2010-09-08 23:19
快速回复:奇怪 IF循环莫名其妙停止了
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017919 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved