User Tools

Site Tools


collections:list

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

collections:list [2018/02/05 05:21] – created wolfgangriedmanncollections:list [2018/02/06 06:31] (current) wolfgangriedmann
Line 1: Line 1:
 ====== System.Collections.Generic.List ====== ====== System.Collections.Generic.List ======
 +
 +The List class is maybe the most simple collections class, and for sure one of the most used.
 +The list class can hold only objects of the same datatype, but of course this datatype can be any basic datatype like a string or a numeric value, any class, and of course also a generic object. If you are using a List objects where members are of type [[:tuples|System.Tuple]], you can build a sort of strongly typed twodimensional array.
 +
 +The List class is using generics, so when declaring and initializing a List object, you need to specify the datatype the List object should hold.
 +
 +<code>local oList as List<string>
 +
 +oList := List<string>{}
 +oList:Add( "Hi girls" )
 +oList:Add( "Hi guys" )</code>
 +
 +You can find more information and samples about the List class in the MSDN: [[https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1|System.Collections.Generic.List<T>]]
  
collections/list.1517808089.txt.gz · Last modified: 2018/02/05 05:21 by wolfgangriedmann