web 2.0

VB.NET & For Each Next

VB.NET & For Each Next - For Each Next : Repeats a group of statements for each element in a collection.

ShotDev Focus:
- VB.NET & For Each Next

Syntax


For Each element [ As datatype ] In group
[ statements ]
[ Continue For ]
[ statements ]
[ Exit For ]
[ statements ]
Next [ element ]

Example

AspNetForEach.aspx

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

Dim arrData(3)
Dim arr As String
arrData(0) = "a"
arrData(1) = "b"
arrData(2) = "c"
arrData(3) = "d"
For Each arr in arrData
Response.write(arr & "<br>")
Next

End Sub
</script>

Screenshot

VB.NET & For Each 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.