Version 1 of dict incr

Updated 2010-11-04 09:09:16 by dkf
dict incr variable key ?increment?

This adds the given increment value (an integer that defaults to 1 if not specified) to the value that the given key maps to in the dictionary value contained in the given variable, writing the resulting dictionary value back to that variable. Non-existent keys are treated as if they map to 0. It is an error to increment a value for an existing key if that value is not an integer.


See also