Checks if an element map with the given identifier exists and if yes returns the total number of keys and elements contained in it.
Parameters:
elementMapId
The element map identifier
keyCount
When specified, this is a reference to the local variable to where the total number of keys contained in the element map must be returned.If the element map does not exist, the variable will be assigned with 0.
This parameter may be useful when debugging templates. See example below on how to use it. (You may also pass
null
instead of a variable reference to not receive any value.)
elementCount
When specified, this is a reference to the local variable to where the total number of elements contained in the element map must be returned.Note: The elements are distinguished by their unique identifiers (see
GOMElement.id
).If the element map does not exist, the variable will be assigned with 0.
This parameter may be useful when debugging templates. See example below on how to use it. (You may also pass
null
instead of a variable reference to not receive any value.)
associationCount
When specified, this is a reference to the local variable to where the total number of key/element associations contained in the element map must be returned.If the element map does not exist, the variable will be assigned with 0.
This parameter may be useful when debugging templates. See example below on how to use it. (You may also pass
null
instead of a variable reference to not receive any value.)
Returns:
true
, if the element map with the specified identifier exists;
false
, if there is no element map with the specified identifier.
Example:
mapId = "My Element Map"; chk = checkElementMap (mapId, @keyCount, @elementCount, @associationCount); echo (mapId + " exists: " + (chk ? "yes" : "no")); echo ("Keys: " + keyCount); echo ("Elements: " + elementCount); echo ("Associations: " + associationCount);
See Also:
countMappedElements(), createElementMap(),
putElementByKey(), putElementsByKeys(), echo()