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

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
DictionaryDictionary for processing.Robin.Dictionary
Yes
KeyKey in the dictionaryRobin.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

  1. Move the "Remove pair" action to the workspace and set its parameters. It is necessary to create a variable "Dictionary" with the type "Dictionary".

  2. Create a numeric variable "Sum of records".

  3. Move the "Get the number of items in the dictionary" action to the workspace and set its parameters. 

  4. Move the "Message" action to the workspace and set its parameters. 
  5. 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 

 

  • Нет меток