The collections in many aspects are similar to the VO arrays, but they differ from them as you need to specify the type of the elements (of course, you can type the elements as object
leaving this completely open.
The collections are available in the namespaces
There are a lot of different Collection
classes, but the most important are:
If you need some help, which Collection class to use, here is a help:
There are a few very important things you should know about collections:
foreach
loop.A few code samples (please look at samples for the single classes System.Collections.Generic.List and System.Collections.Generic.Dictionary) for deeper looks):
using System.Collections.Generic local oList as List<string> local nCount as int oList := List<string>{} oList:Add( "Hi girls" ) oList:Add( "Hi guys" ) nCount := oList:Count foreach cItem as string in oList // do something next oList:Remove( "Hi guys" ) oList:RemoveAt( 0 )
local oDictionary as Dictionary<int,string> local nCount as int oDictionary := Dictionary<int,string>{} oDictionary:Add( 1, "Hi girls" ) oDictionary:Add( 2, "Hi guys" ) foreach oItem as KeyValuePair<int,string> in oDictionary // do something next