大马资讯论坛 - 马来西亚中文资讯平台

标题: Vb.net(Win) For Loop While Loop Do Loop 教学 [打印本页]

作者: 资讯王    时间: 2010-2-3 07:31
标题: Vb.net(Win) For Loop While Loop Do Loop 教学
For Loop
  1. Dim d As Integer
  2. For d = 0 To 2
  3. MessageBox.Show("In the For Loop")
  4. Next d
复制代码
While Loop
  1. Dim d, e As Integer
  2. d = 0
  3. e = 6
  4. While e > 4
  5. e -= 1
  6. d += 1
  7. End While
  8. MessageBox.Show("The Loop ran " & e & "times")
复制代码
Do Loop
  1. Dim str As String
  2. Do Until str = "Cool"
  3. MessageBox.Show("What to do?")
  4. str = "Cool"
  5. Loop
复制代码





欢迎光临 大马资讯论坛 - 马来西亚中文资讯平台 (http://www.freeinfo.com.my/) Powered by Discuz! X3.3