ClearMap

Map command

Syntax

Removes every entry of a map. The map stays usable.

ClearMap(<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

  • After ClearMap, there is no current entry and MapSize() returns 0.
  • Unlike FreeMap(), the map can be filled again right away.

Example

NewMap stock.i()stock("apple") = 3stock("pear") = 5ClearMap(stock())Console(Str(MapSize(stock())))   ' 0stock("plum") = 1Console(Str(MapSize(stock())))   ' 1
In the manual : Arrays, lists and maps