<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2FStatements%2FFor_Each</id>
		<title>VB.Net Tutorial/Statements/For Each - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2FStatements%2FFor_Each"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Statements/For_Each&amp;action=history"/>
		<updated>2026-04-05T01:20:40Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Statements/For_Each&amp;diff=2989&amp;oldid=prev</id>
		<title> в 16:40, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Statements/For_Each&amp;diff=2989&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:30Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 16:40, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Statements/For_Each&amp;diff=2990&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Statements/For_Each&amp;diff=2990&amp;oldid=prev"/>
				<updated>2010-05-26T12:53:57Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==For Each with Collection==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Collections&lt;br /&gt;
&lt;br /&gt;
public class Test&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Dim m_employees As New Collection&lt;br /&gt;
        m_employees.Add(New employee(&amp;quot;A&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;F&amp;quot;))&lt;br /&gt;
        m_employees.Add(New employee(&amp;quot;B&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;H&amp;quot;))&lt;br /&gt;
        m_employees.Add(New employee(&amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;I&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
        For Each emp1 As employee In m_employees&lt;br /&gt;
            If emp1.FirstName = &amp;quot;A&amp;quot; Then Continue For&lt;br /&gt;
            Console.WriteLine(emp1.Title &amp;amp; &amp;quot; &amp;quot; &amp;amp; emp1.FirstName &amp;amp; &amp;quot; &amp;quot; &amp;amp; emp1.LastName)&lt;br /&gt;
        Next emp1&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
    &lt;br /&gt;
Public Class Employee&lt;br /&gt;
    Public FirstName As String&lt;br /&gt;
    Public LastName As String&lt;br /&gt;
    Public Title As String&lt;br /&gt;
    Public Sub New(ByVal first_name As String, ByVal last_name As String, ByVal new_title As String)&lt;br /&gt;
        FirstName = first_name&lt;br /&gt;
        LastName = last_name&lt;br /&gt;
        Title = new_title&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;H B E&lt;br /&gt;
I C D&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use For Each to loop through Array==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Option Strict On&lt;br /&gt;
 Imports System&lt;br /&gt;
 Public Class Employee&lt;br /&gt;
     Private empID As Integer&lt;br /&gt;
     Public Sub New(ByVal empID As Integer)&lt;br /&gt;
         Me.empID = empID&lt;br /&gt;
     End Sub &lt;br /&gt;
     Public Overrides Function ToString( ) As String&lt;br /&gt;
         Return empID.ToString( )&lt;br /&gt;
     End Function &lt;br /&gt;
 End Class &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 Class Tester&lt;br /&gt;
     Shared Sub Main( )&lt;br /&gt;
    &lt;br /&gt;
         Dim intArray( ) As Integer&lt;br /&gt;
         Dim empArray( ) As Employee&lt;br /&gt;
         intArray = New Integer(5) {}&lt;br /&gt;
         empArray = New Employee(3) {}&lt;br /&gt;
    &lt;br /&gt;
         Dim i As Integer&lt;br /&gt;
         For i = 0 To empArray.Length - 1&lt;br /&gt;
             empArray(i) = New Employee(i + 5)&lt;br /&gt;
         Next i&lt;br /&gt;
    &lt;br /&gt;
         Console.WriteLine(&amp;quot;The Integer array...&amp;quot;)&lt;br /&gt;
         Dim intValue As Integer&lt;br /&gt;
         For Each intValue In intArray&lt;br /&gt;
             Console.WriteLine(intValue.ToString( ))&lt;br /&gt;
         Next&lt;br /&gt;
    &lt;br /&gt;
         Console.WriteLine(&amp;quot;The employee array...&amp;quot;)&lt;br /&gt;
         Dim e As Employee&lt;br /&gt;
         For Each e In empArray&lt;br /&gt;
             Console.WriteLine(e)&lt;br /&gt;
         Next&lt;br /&gt;
     End Sub &amp;quot;Run&lt;br /&gt;
 End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;The Integer array...&lt;br /&gt;
0&lt;br /&gt;
0&lt;br /&gt;
0&lt;br /&gt;
0&lt;br /&gt;
0&lt;br /&gt;
0&lt;br /&gt;
The employee array...&lt;br /&gt;
5&lt;br /&gt;
6&lt;br /&gt;
7&lt;br /&gt;
8&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>