VISUAL BASIC: VB In 8 Hours, For Beginners, Learn VB Coding Fast! Visual Basic Programming Language Crash Course, VB Tutorial Book with Hands-On Projects, In Easy Steps! by Yao Ray

VISUAL BASIC: VB In 8 Hours, For Beginners, Learn VB Coding Fast! Visual Basic Programming Language Crash Course, VB Tutorial Book with Hands-On Projects, In Easy Steps! by Yao Ray

Author:Yao, Ray
Language: eng
Format: epub
Publisher: Rails Excel Sharepoint Angularjs Access Lamp Actionscript VBA Photoshop Illustrator ColdFusion Teach Yourself
Published: 2017-01-01T05:00:00+00:00


Access List Elements

The syntax to access List elements looks like this:

For Each element In MyList

Console.WriteLine(element)

Next

For example:

Module Module1

Sub Main()

Dim MyList As New List(Of Integer)

MyList.Add(10)

MyList.Add(20)

MyList.Add(30)

Dim num As Integer

For Each num In MyList ’access all elements

Console.Write(num & " ")

Next

Console.ReadLine()

End Sub

End Module

Output:

10 20 30

Explanation:

“For Each num In MyList…..Next” accesses each elements in MyList and puts the all values to variable “num”.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.