Get the number of elements in a dictionary Version 12 (Net)

Action group: Collections


Description

Returns the number of elements contained in the dictionary

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
DictionaryDictionary for processingRobin.Dictionary
Yes
Results
The number of pairsThe number of pairs «Key-Value» in the dictionaryRobin.Numeric

Special conditions of use

None.

Example of use  

Task

There is a variable "Dictionary" with values: 1 - Moscow, 2 - Tokyo. It is necessary to get the number of records and output the result (sum) in the dialog box 

Solution

Use the actions "Get the number of elements in a dictionary", "Message". 

Implementation

  1. Create a numeric variable "Sum of records", which will be used as the result of the "Get the number of elements in a dictionary" action. 
  2. Move the "Get the number of elements in a dictionary" action to the workspace and set its parameters


  3. Move the "Message" action to the workspace and set its parameters  


  4. Launch the robot using the "Start" button in the top panel 


Result

The sum of dictionary entries = 2 is displayed in the dialog box.


  • Нет меток