VB.NET & Do Loop - Do Loop : Repeats a block of statements while a Boolean condition is True or until the condition becomes True.
ShotDev Focus:
- VB.NET & Do Loop
Syntax
Do { While | Until } condition [ statements ] [ Exit Do ] [ statements ] Loop -or- Do [ statements ] [ Exit Do ] [ statements ] Loop { While | Until } condition
Example
AspNetDoLoop.aspx
<%@ Page Language="VB" %> <script runat="server"> Sub Page_Load(sender As Object, e As EventArgs) Dim i As Integer i = 1 Do While i <= 5 Response.write("www.ShotDev.Com<br>") i = i + 1 Loop Response.write("<hr>") i = 1 Do Response.write("www.ShotDev.Com<br>") i = i + 1 Loop While i <= 5 Response.write("<hr>") i = 1 Do Until i = 5 Response.write("www.ShotDev.Com<br>") i = i + 1 Loop Response.write("<hr>") i = 1 Do Response.write("www.ShotDev.Com<br>") i = i + 1 Loop Until i = 5 End Sub </script>
Screenshot