Vector_new1 |
Homepage Containers |
Creates a new Vector object containing the elements of the specified List object.
VectorObject := Vector_new1(ListObject)
| ListObject | The List object whose contents will be placed into the new Vector. |
If the system has insufficient memory to create the object (very rare), zero will be returned.
The elements in the list are copied (not cloned) and the lock count for each element will be increased by one to reflect being stored in another location.
;Creates a new Array (of length 10) myArray := Array_new(10) Array_set(myArray, 2, String_new("This is index 2")) Array_set(myArray, 5, String_new("Index 5 has a value")) ;Creates a new Vector containing the elements in myArray myVector := Vector_new1(myArray) ;Iterate through each Vector element and output its contents Loop, % Vector_size(myVector) { MsgBox, % "myVector[" A_Index "] = " Vector_get(myVector, A_Index) }