ClearMap()

Syntax

ClearMap(Map())
Description
Clears all the elements in the specified map and releases their memory. After this call the map is still usable, but is empty (i.e. there are no more elements in it).

Parameters

Map() The map to clear.

Return value

None.

Example

  NewMap Country.s()

  Country("FR") = "France"
  Country("US") = "United States"

  ; Proof that items have been added to the map
  Debug "There is " + MapSize(Country()) + " elements in the map"
  
  Debug "Clearing the map..."
 
  ; Clear the map and show that the map really is empty
  ClearMap(Country())
  Debug "There is " + MapSize(Country()) + " element in the map"

See Also

AddMapElement(), DeleteMapElement()

Supported OS

All

<- AddMapElement() - Map Index - CopyMap() ->