Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

Get value Version 10 (Java)

Action group: Collections

...

Description

Gets the value associated with the specified key.

Action icon

Image Added

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
DictionaryThe dictionary to search for an elementRobin.Dictionary
Yes
KeyThe key by which the dictionary lookup is performedRobin.String
Yes
Results
ResultThe resulting variable containing the value associated with the specified keyRobin.Object

Special conditions of use

If you specify a non-existent key in the "Key" parameter, an error will be generated.

Example of use

Task

There is a variable "Dictionary" with values: 1 - Moscow, 2 - Tokyo. Get the value of key 1 and output it to the dialog box 

Image Added

Solution

Use the "Get value" and "Message" actions. 

Implementation 

  1. Create an "object" variable to record the result of the "Get value" action into it.
  2. Move the "Get value" action to the workspace and set the action parameters
    Image Added
  3. Move the "Message" action to the workspace and set the action parameters
    Image Added
  4. Launch the robot using the "Start" button in the top panel. 

Result

The value for key 1 is retrieved from the dictionary and displayed in the dialog box 
Image Added

 

Получить значение по ключу/ get the value by key

Группа действий: Коллекции

Получает значение, связанное с указанным ключом.

Image Removed

Настройки

...

Свойство

...

Англ. наименование

...

Описание

...

Тип

...

Словарь для обработки.

...

Результирующая переменная.

...

Особые условия использования

Если в параметре "Ключ" указать несуществующий ключ, будет вызвана ошибка.

Пример использования

Задача: 

существует переменная "Словарь" с значениями: 1 - Москва, 2 - Токио. Получить значение по ключу 1 и вывести его в диалоговое окно 

Image Removed

Решение: воспользоваться действием "Получить значение по ключу" и "Сообщение". 

Реализация: 

...