PopMapPosition

Map command

Syntax

Goes back to the entry remembered by the last PushMapPosition() and makes it current again.

PopMapPosition(<map>())

Parts

<map>The map, written with its empty parentheses: stock(). It must be a NewMap variable or a map field of a record.

Good to know

  • With nothing pushed, the program stops with "BASIC map position stack is empty".
  • If the remembered entry was deleted in between, the program stops with "Remembered BASIC map element no longer exists".
  • CopyMap() empties the destination's stack.

Example

NewMap m.i()m("a") = 1m("b") = 2FindMapElement(m(), "a")PushMapPosition(m())FindMapElement(m(), "b")PopMapPosition(m())Console(MapKey(m()))   ' a
In the manual : Arrays, lists and maps