[aide] DeleteElement

Archive.
Avatar de l’utilisateur
Progi1984
Messages : 2659
Inscription : mar. 14/déc./2004 13:56
Localisation : France > Rennes
Contact :

[aide] DeleteElement

Message par Progi1984 »

Ne fonctionne pas :

Code : Tout sélectionner

NewList people.s()

  AddElement(people()) : people() = "Tom"
  AddElement(people()) : people() = "Dick"
  AddElement(people()) : people() = "Harry"
  AddElement(people()) : people() = "Bob"

  FirstElement(people())
  DeleteElement(people())
  MessageRequester("Information", "First person in list is "+people(), #PB_MessageRequester_OK)

  LastElement(people())      ; Moves to "Bob"
  PreviousElement(people())  ; Moves to "Harry"
  DeleteElement(people())    ; And deletes him. there is an element before Harry, so it becomes the current
  MessageRequester("Information", "Current person in list is "+people(), #PB_MessageRequester_OK)
Fonctionne :

Code : Tout sélectionner

NewList people.s()

  AddElement(people()) : people() = "Tom"
  AddElement(people()) : people() = "Dick"
  AddElement(people()) : people() = "Harry"
  AddElement(people()) : people() = "Bob"

  FirstElement(people())
  DeleteElement(people())
  FirstElement(people())
  MessageRequester("Information", "First person in list is "+people(), #PB_MessageRequester_Ok)

  LastElement(people())      ; Moves to "Bob"
  PreviousElement(people())  ; Moves to "Harry"
  DeleteElement(people())    ; And deletes him. there is an element before Harry, so it becomes the current
  MessageRequester("Information", "Current person in list is "+people(), #PB_MessageRequester_Ok)