Try OpenEdge Now
skip to main content
BPM Events User's Guide
Persistent structures : Using persistent maps : Using various operators to perform actions
 

Using various operators to perform actions

The operators shown in Table 13 are commonly used in defining or modifying persistent maps.
Table 13. Operators used for persistent maps
Operator
Description
:=
Assigns any value to an attribute of a key.
::=
Assigns the result of a functional expression (for example, min, max, avg) to an attribute of a key, where the first argument of the function is the attribute itself. This notation enables you to avoid repeating the first argument (int this case, the attribute itself) which is assumed to be the same as the expression on the left side.
+=
Adds the value in right hand side to the attribute of a key (numeric type only).
++
Adds 1 to the attribute of a key (numeric type only).
-=
Subtracts the value in right hand side to the attribute of a key (numeric type only).
--
Subtracts 1 from the attribute of a key (numeric type only).

Updating the attributes of a given key

The assignment operator (:= ) modifies the value of any attribute of a key.
A1::M1::ucls0.get("user_key01").avg_resp_time := 15.4;

Adding to or subtracting from the given key attribute

Increment operators += and -= , as well as ++ and -- can be used to add or subtract numeric values of the attributes of the given key:
The three statements below are equivalent:
A1::M1::ucls0.get("user_key01").max_time :=
A1::M1::ucls0.get("user_key01").max_time + 1;
A1::M1::ucls0.get("user_key01").max_time += 1;
A1::M1::ucls0.get("user_key01").max_time ++;
The three statements below are equivalent:
A1::M1::ucls0.get("user_key01").max_time := A1::M1::ucls0.get("user_key01").max_time - 1;
A1::M1::ucls0.get("user_key01").max_time -= 1;
A1::M1::ucls0.get("user_key01").max_time --;