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

Home

 
4D v19.8
collection.pop( )

collection.pop( ) 


 

collection.pop () -> Funktionsergebnis 
Parameter Typ   Beschreibung
Funktionsergebnis  Ausdruck in Letztes Element der Collection

Die Funktion collection.pop( ) entfernt das letzte Element aus der Collection und gibt es als Funktionsergebnis zurück.

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

Ist die Collection leer, gibt collection.pop( ) Undefiniert zurück.

collection.pop( ) lässt sich zusammen mit collection.push( ) für ein Feature "first-in, last-out stack" verwenden:

 C_COLLECTION($stack)
 $stack:=New collection //$stack=[]
 $stack.push(1;2) //$stack=[1,2]
 $stack.pop() //$stack=[1] gibt 2 zurück
 $stack.push(New collection(4;5)) //$stack=[[1,[4,5]]
 $stack.pop() //$stack=[1] gibt [4,5] zurück
 $stack.pop() //$stack=[] gibt 1 zurück



Siehe auch 

collection.push( )
collection.unshift( )

 
EIGENSCHAFTEN 

Produkt: 4D
Thema: Collections
Nummer: 805253

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)