Contains key Version 8 (Java)

Action group: Collections


Description

Determines whether the dictionary contains a key.

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
DictionaryDictionary to checkRobin.Dictionary
Yes
KeyKey to check in the dictionaryRobin.String
Yes
Results
ResultLogical variable whose value is true if the key is contained in the collection, otherwise false.Robin.Booleantrue

Special conditions of use

None.

Example of use  

Task 

There is a variable "Dictionary" with values: 1 - Moscow, 2 - Tokyo. Set up a check for the presence of key 5 in the dictionary and write the result to the boolean variable.

 

Solution

Use the "Contains key" action. 

Implementation 

  1. Create a variable "Boolean variable" to record the result of the "Find value" action into it. 
  2. Move the "Contains key" action to the workspace and set the action settings.
  3. Launch the robot using the "Start" button in the top panel. 

Result

Key 5 was not found in the dictionary 


  • Нет меток