Vector_addAll |
Homepage Containers |
Inserts all the elements in the specified List to this List at the specified position.
Result := Vector_addAll(VectorObject, list)
Result := Vector_addAll(VectorObject, index, list)
| VectorObject | The Vector object to use for the current operation. |
| index | Index at which to insert the list's elements. If omitted, they will be appended to the end of the Vector. |
| list | The List object whose contents will be inserted at the specified position. |
True (1) if any objects were added (i.e. List_size(list) != 0).
False (0) if no objects were added (i.e. List_size(list) = 0)
If VectorObject is NULL (0 or blank), the empty string is returned, to indicate an error.
If the new size (after adding the items) is greater than the capacity, the capacity automatically increases to accommodate the new items. The rate at which the capacity increases is based on the Vector's capacity increment. If the system has insufficient memory to increase the capacity (very rare), the old data remains untouched, and the empty string is returned, to indicate the error.
Index values start at 1 and "wrap".
;Creates a new Vector with the default parameters. myVector := Vector_new() ;Adds a String object to myVector (appends to the end). aString := String_new("Hello World!") Vector_addAll(myVector, aString) ;Adds a String object to myVector (at index 1). aString2 := String_new("Item1") Vector_addAll(myVector, 1, aString2) ;Outputs the two items, in order. MsgBox, % "myVector, index 1: " . Vector_get(myVector, 1) . "`n" . "myVector, index2 : " . Vector_get(myVector, 2)