MapClose
- Last UpdatedJul 18, 2023
- 1 minute read
Closes a map and returns the error status.
Note: There is no limit on the number of maps or map items you can create. However, a large number of maps may require a lot of memory. It is recommended that maps created in custom Cicode are destroyed using MapClose when they are no longer needed.
Note: If the map was created with a close callback, that callback is run before the map is internally closed, so that the map name can be used in the closed callback.
Syntax
INT MapClose(STRING sMapName)
sMapName:
Name of the map to be closed.
Return Value
0 (zero) if successful, otherwise an error code is returned.
If the map name is empty an "Invalid argument" error (274) will be raised and returned.
If the map does not exist a "Record not found" error (536) will be returned.
Example
! Demonstrate MapClose.
STRING sMapName = MapOpen();
! sMapName is a randomly generated text that uniquely identifies the map
INT iMapCloseResult = MapClose(sMapName);
! iMapCloseResult will be set to 0 (NO ERROR)
! The map that is identified by sMapName is now closed and unavailable
Related Functions
MapClear, MapOpen, MapKeyCount, MapKeyDelete, MapKeyExists, MapKeyFirst, MapValueGet, MapKeyNext, MapValueSet, MapValueSet