Script functions reference > Script functions in alphabetical order > A > AddMap

AddMap
Syntax
AddMap(str_mapName, str_key, num_index, str_value);
str_mapName 
str_key 
num_index 
str_value 
A string representing a numeric value to add to the value found in num_index. The number may be given with or without a decimal point. The function rounds the value to the maximum number of decimals given previously or in this parameter. You can use a negative number to subtract.
Description
Adds str_value to the value in num_index of the specified map entry. The map is specified by str_mapName, and the map entry is specified by str_key.
If the map, key or index does not exist, it is created.
Returns
Returns the sum of the old value retrieved from the map, and the value given in str_value.
Example
In this examples, the following map (author) is used.
agatha christie  1890
alfred hitchcock 1899
Example 48
In the following script, the variable $century gets the value 1899 + 100.
$century = AddMap("author","alfred",1,"100");
 
Example 49
The following script adds the map entry astrid:
AddMap("author","astrid",1,"1907");
After the script is executed, author is changed as follows:
agatha christie    1890
alfred hitchcock   1899
astrid lindgren    1907
 
 
OpenText StreamServe 5.6.2 Updated: 2018-01-26