User Tools

Site Tools


collections: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 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.

local oList as List<string>

oList := List<string>{}
oList:Add( "Hi girls" )
oList:Add( "Hi guys" )

You can find more information and samples about the List class in the MSDN: System.Collections.Generic.List<T>

collections/list.txt · Last modified: 2018/02/06 07:31 by wolfgangriedmann