web 2.0

VB.NET & Do Loop

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

VB.NET & Do Loop
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.