Remove pair Version 10 (Net)
Action group: Collections
Description
The action removes the specified key and its associated value from the dictionary
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Dictionary | Dictionary for processing. | Robin.Dictionary | Yes | |
Key | Key in the dictionary | Robin.String | Yes |
Special conditions of use
None.
Example of use
Task
There is a variable "Dictionary" with values: 1 - Moscow, 2 - Tokyo. It is required to remove key 1 from this dictionary, count the number of remaining entries and output the number in the dialog box.
Solution
Use the action "Remove pair", "Show message" and "Get the number of records in a dictionary".
The scheme is as follows:
Implementation
Move the "Remove pair" action to the workspace and set its parameters. It is necessary to create a variable "Dictionary" with the type "Dictionary".
Create a numeric variable "Sum of records".
Move the "Get the number of items in the dictionary" action to the workspace and set its parameters.
- Move the "Message" action to the workspace and set its parameters.
- Launch the robot using the "Start" button in the top panel.
Result
There is 1 entry left in the dictionary, the number is displayed in the dialog box