This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v19.8
collection.combine( )
|
collection.combine ( col2 {; index} ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
col2 | Collection |
![]() |
Collection to combine | |||||
index | Longint |
![]() |
Position to which insert elements to combine in collection (default=length+1) | |||||
Function result | Collection |
![]() |
Original collection containing combined element(s) | |||||
The collection.combine( ) method inserts col2 elements at the end or at the specified index position in the collection instance and returns the edited collection. Unlike the collection.insert( ) method, collection.combine( ) adds each value of col2 in the original collection, and not as a single collection element.
Note: This method modifies the original collection.
By default, col2 elements are added at the end of the orginal collection. You can pass in index the position where you want the col2 elements to be inserted in the collection. Warning: Keep in mind that collection elements are numbered from 0.
C_COLLECTION($c;$fruits)
$c:=New collection(1;2;3;4;5;6)
$fruits:=New collection("Orange";"Banana";"Apple";"Grape")
$c.combine($fruits;3) //[1,2,3,"Orange","Banana","Apple","Grape",4,5,6]
Product: 4D
Theme: Collections
Number:
805254
Created: 4D v16 R6
4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)
4D Language Reference ( 4D v19.4)
4D Language Reference ( 4D v19.5)
4D Language Reference ( 4D v19.6)
4D Language Reference ( 4D v19.7)
4D Language Reference ( 4D v19.8)