Name

dict_put — Adds a key-value pair to a dictionary

Synopsis

int dict_put ( inout dict dictionary ,
in key any ,
in value any );

Description

The function adds or updates a key-value pair in the given dictionary. If the dictionary contains a pair with the key part equivalent to the given one then old value is replaced with a new one. Otherwise, a new pair is added to the dictionary.

Parameters

dict

The dictionary to be updated or extended.

key

The key part of the dictionary pair to be added or updated.

value

The dependent part of the pair.

Return Types

The function returns the total number of pairs stored in the dictionary as counted after the modification.