web 2.0

VB.NET & For Next

VB.NET & For Next - For Next : Repeats a group of statements a specified number of times.

ShotDev Focus:
- VB.NET & For Next

Syntax


For counter [ As datatype ] = start To end [ Step step ]
[ statements ]
[ Exit For ]
[ statements ]
Next [ counter ]

Example

AspNetForNext.aspx

<%@ Page Language="VB" %>
<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)

Dim i As Integer
For i = 0 To 5
Response.write(i &" ShotDev.Com <br>")
Next
Response.write("<hr>")

For i = 0 To 10 Step 3
Response.write(i &" ShotDev.Com <br>")
Next
Response.write("<hr>")

For i = 10 To 0 Step -2
Response.write(i &" ShotDev.Com <br>")
Next
Response.write("<hr>")

End Sub
</script>

Screenshot

VB.NET & For Next
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.