Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

MapClear

  • Last UpdatedJul 18, 2023
  • 1 minute read

Clears all entries in a map and returns the error status.

Syntax

INT MapClear(STRING sMapName)

sMapName:

Name of the map to be cleared.

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 MapClear.

STRING sMapName = MapOpen();

! sMapName is a randomly generated text that uniquely identifies the map

INT iMapValueSetResult = MapValueSet(sMapName, “SomeKey”, “SomeValue”);

! iMapValueSetResult will be set to 0 (NO ERROR)

INT iMapKeyCountResultExpectOne = MapKeyCount(sMapName);

! iMapKeyCountResultExpectOne will be set to 1

INT iMapClearResult = MapClear(sMapName);

! iMapClearResult will be set to 0 (NO ERROR)

INT iMapKeyCountResultExpectZero = MapKeyCount(sMapName);

! iMapKeyCountResultExpectZero will be set to 0

INT iMapCloseResult = MapClose(sMapName);

! iMapCloseResult will be set to 0 (NO ERROR)

! The map that is identified by sMapName is now closed and unavailable

MapOpen, MapExists, MapKeyCount, MapKeyDelete, MapKeyExists, MapKeyFirst, MapValueGet, MapKeyNext, MapValueSet, MapValueSetQuality

See Also

Map Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in