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

Ключ

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

Insert collection Version 10 (Net)

Action group: Arrays 

...

The action inserts the collection into the list by index. Defaults to the beginning of the list.

Action icon

Image Added

Parameters

Input parameters

List - list for processing.

Index - index in the list.

Collection for inserting - the collection, that will be inserted in the list by the specified index.

Settings

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ListList for processing

Вставить коллекцию/ Paste collection

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

Действие вставляет коллекцию в список по индексу. По умолчанию в начало списка.

Image Removed

Настройки

Свойство

Описание

Тип

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

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

Параметры

Список

Список для обработки
.Robin.Collection
Да

Yes

Индекс

Индекс в списке
IndexIndex in the listRobin.Numeric

Нет

Коллекция для вставки

Коллекция, которая будет вставлена в список по указанному индексу

No
Collection for insertingThe collection, that will be inserted in the list by the specified indexRobin.Collection

Да

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

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

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

Задача: существует переменная "Коллекция 1" с 3-мя записями = 0. Оля, 1.Маша, 2.Катя, и переменная "Коллекция 2" с 2-мя записями= 0.Иван, 1.Петр. Необходимо добавить записи коллекции 2 в коллекцию 1 по умолчанию в начало списка. Вывести итоговое количество значений коллекции 1 в диалоговом окне и проверить значение по индексу =0. 

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

Реализация: 

...


Yes

 

Special conditions of use

For Java:

  • If the "Index" field is not filled in, the collection for inserting is placed in the beginning of the list.

For Net:

  • If the "Index" field is not filled in, the collection for inserting is placed in the end of the list.

Example of use

Task

There is a variable "Collection-1" with 3 records:

  • 0. Jane
  • 1. Mary
  • 2. Kate

Variable "Collection-2" has 2 records:

  • 0. John
  • 1. Peter

Add "Collection 2" records to "Collection 1". Output the total number of "Collection 1" values in the dialog box and check the value by index "0".

Solution

Use the "Insert collection", "Show message", "Get value by index" actions. 

Implementation

  1. Assemble a robot scheme with the actions:
    Image Added

  2. Set the "Insert collection" action parameters.
    Image Added

  3. Set the "Show message" action parameters. 
    Image Added

  4. Set the Get value by index" action parameters.
    Image Added

  5. Run the robot by clicking "Start" in the top panel.

Result

A dialog box was displayed with the number of items in "Collection 1". 

Image Added

The value at index "0" was obtained. Since the values from "Collection 2" were placed at the end of the "Collection 1" list. 

Image Added

 

Результат: количество элементов в Коллекции 1 составило 5, на экран выведено диалоговое окно. 

Image Removed

Получено значение по индексу 0 = Иван. Так как значения из коллекции 2 были помещены в начало списка коллекции 1. 

Image Removed