CollectionCreate
The CollectionCreate function allows you to create a list collection.
Prototype
CollectionCreate(IsDictionary ; ValueType ; Initialization Values)
Arguments
IsDictionary Boolean By value
Argument defining the collection type.
- True : create a dictionary collection
- False: create a list collection
ValueType By value
Argument contains the data type of the list. The data type will be detected from the passed argument.
In general, all supported data types can be stored in the dictionary.
Initialization Values By value
As an option (not mandatory) a set of pair values (Key and Value) to be added to the collection.
The type of the values must be equal to the ValueType and the number of values can be a sequence of
values separated by a semicolon (;).
Returns
List
Exception
Undefined
Undefined is returned if:
- The ValueType parameter contains a not supported type or one of the initialization values is not consistent
with the type of list.
- IsDictionary is not a Boolean.
Examples
$$myList = CollectionCreate(false; 0)
This will return an empty list of numbers into the variable $$myList.
First argument (false) to create a list collection; second argument (0) to be used to define the list data type as numeric.
$$myList = CollectionCreate(false; '')
This will return an empty list of strings into the variable $$myList.
First argument (false) to create a list collection; second argument ('') to be used to define the list data type as string.
$$myList = CollectionCreate(false ; '' ; 'a' ; 'b' ; 'c')
This will return a list of strings into the variable $$myList.
This will create a [list of strings] into the variable $$myList. The list is initialized with the values: [a], [b] and [c].
First argument (false) to create a list collection; second argument ('') to be used to define the list data type as string and initialization values.