D
Daniel Walzenbach
Hello,
could somebody please explain me which code sample is superior above the other and why. Or are they practically the same?
' For Each
Dim myArrayList As New System.Collections.ArrayList
Dim myint As System.Int32
For Each myint In myArrayList
' do something
Next
' Enumerator
Dim myEnumerator As IEnumerator
myEnumerator = myArrayList.GetEnumerator
While myEnumerator.MoveNext
' do something
End While
Thank you a lot! I appreciate your efforts.
Daniel Walzenbach
could somebody please explain me which code sample is superior above the other and why. Or are they practically the same?
' For Each
Dim myArrayList As New System.Collections.ArrayList
Dim myint As System.Int32
For Each myint In myArrayList
' do something
Next
' Enumerator
Dim myEnumerator As IEnumerator
myEnumerator = myArrayList.GetEnumerator
While myEnumerator.MoveNext
' do something
End While
Thank you a lot! I appreciate your efforts.
Daniel Walzenbach