The List function creates a list from a passed parameter list. When assigning to typed lists (e.g. strings, long, double, etc.), it must be ensured that the list entries correspond to the type of the variable.
An alternative spelling is a comma-separated list in curly brackets.
Syntax | ||||
List(Value1, [Value2, [Value3, [...]])) | ||||
Return value | ||||
Type |
Description | |||
Type-less value list |
Only when you assign to a typed variable, the list entries are converted to the type of the variable. | |||
Parameter | ||||
Use |
Name |
Type |
Passing |
Description |
Required |
Value1 |
Variant |
ByVal |
First entry (is getting index 0) |
Optional |
Value2 to n |
Variant |
ByVal |
Further entries |
Example
Dim V1() As Variant
V1 := List("TAP.CON", "Configuration", "Expert", 100, 200)
V1 := {"TAP.CON", "Configuration", "Expert", 100, 200}
Result: V1 now contains the value TAP.CON in index 0. Configuration in index 1 and so on.