简单的问题,送分的。 for i=1 to 10 ---- if i=5 then exit for ---- end if next 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 if i=5 then Exit For 可以試一下在里面用Select 語句呀 For i = 1 To 10 Select Case i Case Is < 5 ' Add Code You Want to Do Case Is > 5 ' Add Code You Want to Do End SelectNext 不要 GOTO ,不要 IF THEN ,那 SELECT 如何? 和IF 是一样的还不行,那换语言吧楼主! Goto还是不要用了吧。这样不很好吗哦你的意思肯定不要是退出,而且当等于5时跳过去那就是for i=1 to 10……(语句)if i=4 then i=i+1next i exit for 晕呀我要的是跳出本次循环,不是整个循环。 lightwiter1的做法不错up up 呵呵,可以这样:Private Sub Command1_Click()Dim temp As Stringtemp = ""For I = 1 To 10If I <> 5 Then temp = temp & " " & INextMsgBox tempEnd Sub lightwiter1(lightwiter) 你的做法是可以。还有用goto也可以。没有什么函数和命令吗?就象C里的continue结束本次循环,back结束整个循环。 exit for;exit do不都可以的吗? 如果不想用goto,if,select,那我好象在VB里还没遇到过! i=1do while i<=10 if i=5 then i=i+1 ... i=i+1loop 我算是看明白了要问的什么了可以这样子了(我以前用QB时老这样)for i = 1 to k .... if i= 5 then next i ....next i但为什么不用Goto呢?这个命令可是Basic的精品哟,我很喜欢她的!!! 是不是VB没有像C的continue一样功能的的函数或命令。那只有用goto了。唉……。 continue好象是没有,我也有你类似的问题,只好判断一下了 【惯例】节日散分(三) 散分:工作经历,待遇变化,现在是留还是走,谈谈你的看法 关于Microsoft Excel 9.0 Object Library类,提问(急,在线等) 火急!!!大家一定要帮我,分不够好说! 如何让程序模拟键盘和鼠标~~ 先统计一个表中的数据,在将该数据写进另一个表中 请问VB中使用API函数 loadimage 在WIN 2K/NT下如何使用? 拷贝的MSDN中的msdnvs98.col不能打开,在VB里也不能按F1热键调出,哪位有高招? VB操作Excel 关于api的问题 呵呵 只有那么多分 界面设计 vb中有没有一个过程能捕捉到所有的事件
For i = 1 To 10
Select Case i
Case Is < 5
' Add Code You Want to Do
Case Is > 5
' Add Code You Want to Do
End Select
Next
哦你的意思肯定不要是退出,而且当等于5时跳过去
那就是
for i=1 to 10……(语句)
if i=4 then i=i+1
next i
我要的是跳出本次循环,不是整个循环。
up up
Dim temp As String
temp = ""
For I = 1 To 10
If I <> 5 Then temp = temp & " " & I
Next
MsgBox temp
End Sub
还有用goto也可以。
没有什么函数和命令吗?
就象C里的continue结束本次循环,back结束整个循环。
do while i<=10
if i=5 then i=i+1
...
i=i+1
loop
可以这样子了(我以前用QB时老这样)
for i = 1 to k
....
if i= 5 then next i
....
next i但为什么不用Goto呢?这个命令可是Basic的精品哟,我很喜欢她的!!!
那只有用goto了。唉……。