collections
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
collections [2018/02/04 18:23] – created wolfgangriedmann | collections [2018/02/05 05:20] (current) – wolfgangriedmann | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Collections ====== | ====== Collections ====== | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | The collections are available in the namespaces | ||
+ | * System.Collections | ||
+ | * System.Collections.Generic | ||
+ | * System.Collections.Concurrent | ||
+ | * System.Collections.ObjectModel | ||
+ | * System.Collections.Specialized | ||
+ | There are a lot of different '' | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | If you need some help, which Collection class to use, here is a help: | ||
+ | |||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | There are a few very important things you should know about collections: | ||
+ | * They are not arrays, and therefore they are **0-based**, | ||
+ | * You **cannot** change a collection while you are using it in a '' | ||
+ | * most collections are using generics, to you need to specify the type(s) of the elements in the declaration of the variable | ||
+ | |||
+ | A few code samples (please look at samples for the single classes [[collections: | ||
+ | < | ||
+ | local oList as List< | ||
+ | local nCount as int | ||
+ | |||
+ | oList := List< | ||
+ | oList:Add( "Hi girls" ) | ||
+ | oList:Add( "Hi guys" ) | ||
+ | nCount := oList: | ||
+ | foreach cItem as string in oList | ||
+ | // do something | ||
+ | next | ||
+ | oList: | ||
+ | oList: | ||
+ | < | ||
+ | local nCount as int | ||
+ | |||
+ | oDictionary := Dictionary< | ||
+ | oDictionary: | ||
+ | oDictionary: | ||
+ | foreach oItem as KeyValuePair< | ||
+ | // do something | ||
+ | next</ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
collections.1517768611.txt.gz · Last modified: 2018/02/04 18:23 by wolfgangriedmann