Get keys Version 8 (Java)

Action group: Collections


Description

Gets a collection of keys that have the specified value

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
DictionaryDictionary for processing.Robin.Dictionary
Yes
Results
ResultA variable containing a collection of all the dictionary keys.Robin.Collection

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 a collection of keys and output the result (sum) in the dialog box 

Solution

Use the "Get keys", "Get length", and "Message" actions. 

Implementation

Create a "Collection" variable that will be used as the result of the "Get keys" action. 

  1. Move the "Get keys" action to the workspace and set its parameters
  2. Create a numeric variable "Sum of keys" to be used as the result of the "Get length" action. 
  3. Move the "Get length" 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 

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



 

  • Нет меток