Updated 2013-08-28 10:46:03 by RLE

Summary  edit

increment a value in a dictionary

Synopsis  edit

dict incr variable key ?increment?

Description  edit

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, and returning the value of the entire dictionary. 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  edit