作者chinagogoya (下棋逍遥游)
看板Visual_Basic
标题[VB6 ] VB怎样呈现C语言的continue
时间Mon May 27 20:10:42 2013
C 语言的continue 是可以指令重新执行for回圈,
请问VB有哪个语法有continue的功能?
EX:
for i = 0 to 10
List1.AddItem = i
if i = 5 then ???
next i
我想要不把5这个函数印在list1上,请问怎麽用?
--
学习感想:
http://ppt.cc/94uu 学习态度:
http://ppt.cc/NQrD
心得:
诈欺游戏:
http://ppt.cc/39P- 解残局:
http://ppt.cc/FpGm
那些年:
http://ppt.cc/1JuM 中二病:
http://ppt.cc/OM-S
少年Pi:
http://ppt.cc/NJh8 斗棋:
http://ppt.cc/WPqF
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.121.200.43
1F:→ DeathWatch:回圈外写 nextFor: Next i 05/27 20:43
2F:→ DeathWatch:if i = 5 then goto nextFor 05/27 20:43
3F:→ tsongs:if i <> 5 then : List1.AddItem = i : Endif '这样也可 05/27 20:56
4F:→ DeathWatch:楼上好棒 05/27 21:30
5F:→ chinagogoya:了解了,也就是没continue用法。 05/27 21:47
for(i=0;i<=10;i++)
{
if(i==5) continue;
[statement]
}
C语言是这样写的,看来VB是没continue,感谢讲解。
※ 编辑: chinagogoya 来自: 140.121.200.43 (05/27 21:49)
6F:推 fumizuki:VB.NET才有continue 05/27 23:47
7F:→ DeathWatch:java也有 05/28 00:31
8F:→ chinoyan:三楼那个 : Endif ,不加也可以吧 05/28 05:16
9F:→ MOONRAKER:单行if少用,因为你不知道将来会不会加新东西进去。 05/28 09:04
10F:→ tsongs:那是因为推文想一行写完 05/28 16:35
11F:推 chinoyan:单行IF,没END IF,在IDE有自动缩排的情况,不会忘了加回去 05/29 06:12
12F:→ chinoyan:所以没差,如果CODE缩排没有,就可能会出问题 05/29 06:12
13F:→ tsongs:如果多个用Select case比较方便 05/29 10:15
14F:→ tsongs:select case i 05/29 10:16
15F:→ tsongs:case 1,3,5 '1,3,5 不要 05/29 10:18
16F:→ tsongs:case else : List1.AddItem = i '其他要的写进去 05/29 10:18
17F:→ tsongs:end select 05/29 10:19