Array_new1 |
Homepage Containers |
Creates a new Array object containing the elements of the specified List object.
ArrayObject := Array_new1(ListObject)
| ListObject | The List object whose contents will be placed into the new Array. |
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 Vector with default parameters myVector := Vector_new() Vector_add(myVector, String_new("An item")) Vector_add(myVector, String_new("Another item")) Vector_add(myVector, String_new("Final item")) ;Creates a new Array containing the elements in myVector myArray := Array_new1(myVector) ;Iterate through each Array element and output its contents Loop, % Array_size(myArray) { MsgBox, % "myArray[" A_Index "] = " Array_get(myArray, A_Index) }