EXTEND v11
The EXTEND
method increases the size of a collection. There are three variations of the EXTEND
method. The first variation appends a single NULL
element to a collection; the syntax for the first variation is:
collection
is the name of a collection.
The following example demonstrates using the EXTEND
method to append a single, null element to a collection:
COUNT
indicates that before the EXTEND
method, there were 5
elements in the collection; after the EXTEND
method was invoked, the collection contains 6
elements.
The second variation of the EXTEND
method appends a specified number of elements to the end of a collection.
collection
is the name of a collection.
count
is the number of null elements added to the end of the collection.
The following example demonstrates using the EXTEND
method to append multiple null elements to a collection:
COUNT
indicates that before the EXTEND
method, there were 5
elements in the collection; after the EXTEND
method was invoked, the collection contains 8
elements.
The third variation of the EXTEND
method appends a specified number of copies of a particular element to the end of a collection.
collection
is the name of a collection.
count
is the number of elements added to the end of the collection.
index_number
is the subscript of the element that is being copied to the collection.
The following example demonstrates using the EXTEND
method to append multiple copies of the second element to the collection:
COUNT
indicates that before the EXTEND
method, there were 5
elements in the collection; after the EXTEND
method was invoked, the collection contains 8
elements.
Note
The EXTEND
method cannot be used on a null or empty collection.