VB.Net/Language Basics/Do While — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 15:42, 26 мая 2010
Do Loop While
<source lang="vbnet"> Imports System Public Class MainClass
Shared Sub Main(ByVal args As String()) Dim counterVariable As Integer = 100 Do Console.WriteLine("counterVariable: {0}", counterVariable) counterVariable = counterVariable + 1 Loop While counterVariable < 10 End Sub
End Class
</source>
Do While Loop
<source lang="vbnet"> Imports System public class MainClass
Shared Sub Main() Dim counterVariable As Integer = 0 Do While counterVariable < 10 Console.WriteLine("counterVariable: {0}", counterVariable) counterVariable = counterVariable + 1 Loop End Sub
End Class
</source>
If inside Do While loop
<source lang="vbnet"> Imports System public class MainClass
Shared Sub Main() Dim counterVariable As Integer = 0 Do Console.WriteLine("counterVariable: {0}", counterVariable) counterVariable = counterVariable + 1 If counterVariable > 9 Then Exit Do End If Loop End Sub
End Class
</source>