Cicode Programming Reference > Cicode Function Categories > Map Functions > MapClose

MapClose

Closes a map and returns the error status.

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, MapExists, MapKeyCount, MapKeyDelete,MapKeyExists, MapKeyFirst, MapValueGet, MapKeyNext, MapValueSet, MapValueSetQuality

See Also

Published June 2018