Dies ist die alte 4D Dokumentations-Website. Die neue und aktualisierte Dokumentation finden Sie unter developer.4d.com

Home

 
4D v19.8
collection.push( )

collection.push( ) 


 

collection.push ( Element {; Element2 ; ... ; ElementN} ) -> Funktionsergebnis 
Parameter Typ   Beschreibung
Element  Ausdruck in Element(e) zum Hinzufügen in der Collection
Funktionsergebnis  Collection in Ursprüngliche Collection mit hinzugefügtem Element(en)

Die Funktion collection.push( ) fügt ein oder mehrere Element(e) am Ende der Collection Instanz an und gibt die bearbeitete Collection zurück.

Hinweis: Diese Funktion ändert die ursprüngliche Collection.

 C_COLLECTION($col)
 $col:=New collection(1;2) //$col=[1,2]
 $col.push(3) //$col=[1,2,3]
 $col.push(6;New object("firstname";"John";"lastname";"Smith"))
  //$col=[1,2,3,6,{firstname:John,lastname:Smith}

Die resultierende Collection sortieren:

 C_COLLECTION($col;$sortedCol)
 $col:=New collection(5;3;9) //$col=[5,3,9]
 $sortedCol:=$col.push(7;50).sort()
  //$col=[5,3,9,7,50]
  //$sortedCol=[3,5,7,9,50]



Siehe auch 

collection.pop( )
collection.shift( )

 
EIGENSCHAFTEN 

Produkt: 4D
Thema: Collections
Nummer: 705255

Dieser Befehl kann in preemptive Prozessen laufen

 
SEITENINHALT 
 
GESCHICHTE 

Erstellt: 4D v16 R6

 
ARTIKELVERWENDUNG

4D Programmiersprache ( 4D v19)
4D Programmiersprache ( 4D v19.1)
4D Programmiersprache ( 4D v19.4)
4D Programmiersprache ( 4D v19.5)
4D Programmiersprache ( 4D v19.6)
4D Programmiersprache ( 4D v19.7)
4D Programmiersprache ( 4D v19.8)