copy (lists)

Syntax

<Path>.copy  → list or table
<Path>.copy(Range:listrange) → list or table

The method copy copies an entire list/table or a range and returns it as a value of data type list/table.

When you do not enter a range, Plant Simulation copies the entire list. A range may only encompass a single range.

If you would also like to copy the column index and/or the row index during the copy process, then enter the column 0 and/or the row 0 into the range.

The method applies to the objects DataStack, DataQueue, DataList, DataTable, and TimeSequence.

Parameter

The parameter Range of data type listrange designates the range.

Return Value

The return value has the data type list/table.

You can then process the copied region in a number of ways:

  • Assign the copied range to a local variable of the corresponding type.

    Example

    var MyDataList : list[integer]
    MyDataList := MyDataList1.copy({1}..{5})
    ...
  • Insert the copied range into the column of a table. The column where you paste the range has to have the same data type as the DataList.

    Example

    MyDataTable.insertList(3,1,MyDataList.copy({1}..{5}))
  • Make the copied range a DataList of its own. Data type is list. Therefore you can assign it to a cell in a DataList of data type list.

    Example

    MyDataList.insertList(2,tab.copy({1,1}..{1,5}))