VB.Net/Language Basics/Do Until — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 12:42, 26 мая 2010
Do Until Loop
Imports System
Public Class MainClass
Shared Sub Main(ByVal args As String())
Dim counterVariable As Integer = 0
Do Until counterVariable = 10
Console.WriteLine("counterVariable: {0}", counterVariable)
counterVariable = counterVariable + 1
Loop " Until counterVariable = 10
End Sub
End Class
Exit from Do Until
Imports System
Public Class MainClass
Shared Sub Main(ByVal args As String())
Dim counter As Integer
Do Until counter > 10
" skip remaining code in loop only if counter = 5
If counter = 5 Then
Exit Do
End If
counter += 1
Loop
Console.WriteLine("counter = " & counter & _
" after exiting Do Until/Loop structure" & vbCrLf)
End Sub
End Class