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

Ключ

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

...

Remove object Version 16 (Net)

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

Описание

Действие удаляет объект из коллекции по его индексу или значению.

Иконка

Image Removed

Параметры действия

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

Коллекция                   Коллекция для обработки

Индекс                         Порядковый номер позиции, которую необходимо удалить. Нумерация начинается с 0

Значение                     Значение удаляемого элемента

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

Результат Результирующая переменная, содержащая удаленное значение

Настройки

...

Свойство

...

Описание

...

Тип

...

Description

The action removes an object from the collection by its index or value

Action icon

Image Added

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
CollectionCollection for processingRobin.Collection
Yes
IndexThe index of the element to removeRobin.Numeric
No
ValueThe value of the element to removeRobin.Object
No
Results
ResultThe resulting variable containing removed valueRobin.Object

Special conditions of use

The resulting collection will be stored in the action parameter "Collection".

If you specify an index and a value at the same time, the action will accept only the index, not the value, as input.

Case:

"Collection 1" contains

...

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

Результирующая коллекция будет сохранена в параметре действия "Коллекция".

Если указать индекс и значение одновременно, то действие примет как входной параметр только индекс, не значение.

Кейс:

"Collection 1" содержит:

  • 0. Russia
  • 1. Japan
  • 2. Germany

Если в действии указать параметры индекс If you specify the parameters index "1", и значение and the value "Germany" in the action, то "Collection 1" примет следующий видwill take the following form:

  • 0. Russia
  • 1. Germany

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

Задача

Существует переменная "Collection 1" со значениями стран:

Image Removed

Необходимо удалить значение с индексом "0" . Затем получить значения по индексам "0" и "1", результаты вывести в диалоговые окна. 

Решение

Example of use

Task

There is a variable "Collection 1" with the values of the countries:

Image Added

It is necessary to delete the value with index "0" . Then get the values with indexes "0" and "1" and output the results in dialog boxes. 

Solution

Use the actions Воспользоваться действиями "Remove object", "Get value by index", "Show message". 

Реализация

Implementation

  1. Assemble a robot scheme consisting of actionsСобрать схему робота, состоящую из действий:


  2. Создать переменные с типом Create variables with the type "Object": 


  3. Настроить параметры действия Set the parameters of the "Remove object" action


  4. Настроить параметры действия Set the parameters of the "Get value by index  11" action


  5. Настроить параметры действия Set the parameters of the "Get value by index 2index 2" action

    Настроить параметры действия 
  6. Set the parameters of the "Show message 1message 1" action


  7. Настроить параметры действия Set the parameters for the "Show message message 2" action


  8. Запустить робота по кнопке "Запуск" в верхней панелиLaunch the robot using the "Start" button in the top panel

Результат

Result

The required object is removed from the collection (value Требуемый объект удален из коллекции (значение "China"). Отображены последовательно два диалоговых окна со странами Two dialog boxes with the countries "Japan" и and "Russia" are displayed consecutively