4D v17.4

collection.fill( )

Accueil

 
4D v17.4
collection.fill( )

collection.fill( )  


 

La méthode collection.fill( ) remplit les éléments de la collection avec valeur, optionnellement depuis l'élément positionDépart et jusqu'à l'élément fin (non inclus), et retourne la collection résultante.

Note : Cette méthode modifie la collection d'origine.

Exemple  

 C_COLLECTION($c)
 $c:=Creer 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]



Voir aussi  

collection.resize( )

 
PROPRIÉTÉS 

Produit : 4D
Thème : Collections
Nom intl. : collection.fill( )

Commande(s) éligible(s) à l'exécution dans un process préemptif

 
PAGE CONTENTS 
 
HISTORIQUE 

 
UTILISATION DE L'ARTICLE

4D - Langage ( 4D v17)
4D - Langage ( 4D v17.1)
4D - Langage ( 4D v17.2)
4D - Langage ( 4D v17.3)
4D - Langage ( 4D v17.4)