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

Ключ

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

...

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

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

Описание 

Возвращает число элементов, содержащихся в словаре.

Иконка действия

Image Removed

Параметры

Входные параметры

  1. Словарь- словарь в котором будет производится подсчет пар значении;

Выходные параметры

  1. На выходе Количество пар «ключ-значение» словаря.

Настройки

...

Description

Returns the number of elements contained in the dictionary

Action icon

Image Added

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
DictionaryDictionary for processing

Свойство

Описание

Тип

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

Обязательность заполнения поля

Параметры

Словарь

Словаря для обработки
Robin.Dictionary
Да

Yes
Результаты

Количество пар

Количество пар «ключ-значение» словаря
Results
The number of pairsThe number of pairs «Key-Value» in the dictionaryRobin.Numeric

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

Отсутствуют.

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

Задача

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

Image Removed

Решение

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

Реализация

...



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 

Image Added

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
    Image Added

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

  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

Результат

В диалоговое окно выведена сумма записей словаря  = 2.