Vector_remove |
Homepage Containers |
Destroys the element stored at the specific position in the Vector object, and removes it.
Result := Vector_remove(VectorObject, index)
| VectorObject | The Vector object to use for the current operation. |
| index | Index of element to remove. |
If VectorObject is NULL (0 or blank), the empty string is returned, to indicate an error.
When removing an object, the previous object is destroyed. Call Vector_discard, instead, if you wish to only discard the previous object. The object will not be destroyed if the lock count for the element is more than one. In this case, the lock count will be decreased by one, and Result will be the negative of the new lock count. So, if Result < 0, -Result is the lock count for the previous object.
Index values start at 1 and "wrap".
Vector_set, Vector_replace, Vector_discard
;Creates a new Vector with the default parameters. myVector := Vector_new() ;Adds a String object to myVector. aString := String_new("Hello World!") Vector_add(myVector, aString) ;Destroys the last object, and removes it. Vector_remove(myVector, 0)