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

AVEVA™ Plant SCADA

MapKeyExists

  • Last UpdatedJul 18, 2023
  • 1 minute read

Use this function to check if a key exists in a map.

Syntax

INT MapKeyExists(STRING sMapName, STRING sKeyName)

sMapName:

Name of map to get the value from.

sKeyName:

Name of the key to get the value from.

Example

! Demonstrate MapKeyExists.
STRING sMapName = MapOpen();
! sMapName is a randomly generated text that uniquely identifies the map
INT iMapKeyExistsResultExpectFalse = MapKeyExists(sMapName, "SomeKey");
! iMapKeyExistsResultExpectFalse will be set to FALSE (zero)
INT iMapValueSetResult = MapValueSet(sMapName, "SomeKey", "SomeValue");
INT iMapKeyExistsResultExpectTrue = MapKeyExists(sMapName, "SomeKey");
! iMapKeyExistsResultExpectTrue will be set to TRUE (non-zero)
INT iMapCloseResult = MapClose(sMapName);
! The map that is identified by sMapName is now closed and unavailable

Return Value

TRUE if the map exists, or FALSE if not.

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

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

See Also

Map Functions

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