This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v19.8
collection.fill( )
|
collection.fill ( value {; startFrom {; end}} ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
value | Number, Text, Collection, Object, Date, Boolean |
![]() |
Filling value | |||||
startFrom | Longint |
![]() |
Start index (included) | |||||
end | Longint |
![]() |
End index (not included) | |||||
Function result | Collection |
![]() |
Original collection with filled values | |||||
The collection.fill( ) method fills the collection with the specified value, optionally from startFrom index to end index, and returns the resulting collection.
Note: This method modifies the original collection.
C_COLLECTION($c)
$c:=New collection(1;2;3;"Lemon";Null;"";4;5)
$c.fill("2") // $c:=[2,2,2,2,2,2,2,2]
$c.fill("Hello";5) // $c=[2,2,2,2,2,Hello,Hello,Hello]
$c.fill(0;1;5) // $c=[2,0,0,0,0,Hello,Hello,Hello]
$c.fill("world";1;-5) //-5+8=3 -> $c=[2,"world","world",0,0,Hello,Hello,Hello]
Product: 4D
Theme: Collections
Number:
805262
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)