История страницы
...
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
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Dictionary | Dictionary for processing |
Свойство
Описание
Тип
Пример заполнения
Обязательность заполнения поля
Параметры
Словарь
Robin.Dictionary |
Yes |
Количество пар
Results | ||||
The number of pairs | The number of pairs «Key-Value» in the dictionary | Robin.Numeric |
Особые условия использования
Отсутствуют.
Пример использования
Задача
существует переменная "Словарь" с значениями: 1 - Москва, 2 - Токио. Необходимо получить количество записей и вывести результат (сумму) в диалоговое окно
Реализация
...
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
Use the actions "Get the number of elements in a dictionary", "Message".
Implementation
- 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.
- Move the "Get the number of elements in a dictionary" action to the workspace and set its parameters
- Move the "Message" action to the workspace and set its parameters
- 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.