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

AVEVA™ Plant SCADA

MapKeyCount

  • Last UpdatedJul 18, 2023
  • 1 minute read

Use this function to retrieve the number of keys in a map.

Syntax

INT MapKeyCount(STRING sMapName)

sMapName:

Name of the map.

Return Value

The number of keys in the map, or a value less than 0 if an error is encountered.

If the map name is empty an "Invalid argument" error (274) will be raised.

Example

! Demonstrate MapKeyCount.
STRING sMapName = MapOpen();
! sMapName is a randomly generated text that uniquely identifies the map
INT iMapKeyCountResultExpectZero = MapKeyCount(sMapName);
! iMapKeyCountResultExpectZero will be set to 0
INT iMapValueSetResult = MapValueSet(sMapName, "SomeKey", "SomeValue");
INT iMapKeyCountResultExpectOne = MapKeyCount(sMapName);
! iMapKeyCountResultExpectOne will be set to 1
INT iMapCloseResult = MapClose(sMapName);
! The map that is identified by sMapName is now closed and unavailable

MapClear, MapClose, MapOpen, MapKeyDelete, MapKeyExists, MapKeyFirst, MapValueGet, MapKeyNext, MapValueSet, MapValueSet

See Also

Map Functions

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