ModifyArray

function ModifyArray(ArrayObject: any[], Operation: string, SelectedIndex: number, Input: any): any[]

The function ModifyArray allows you to modify an array and returns this as the return value. The following operations can be applied to the array:

  1. Add: Adds a suitable element to a selected position in the array.
  2. AddEmpty: Adds an empty element to a selected position in the array.
  3. RemoveSelected: Removes a selected element from the array.

Parameter

Name

Type

Description

ArrayObject

Array

The symbol of type array to be modified.

Operation

tchmi:framework#/definitions/ModifyArrayOperation

The type of modification to be made to the array. Can be chosen from the Enumeration:

  • Add: Adds the element from the parameter Input
  • AddEmpty: Adds an empty element.
  • RemoveSelected: Removes the element.

SelectedIndex

number

The array index at which the array is to be modified. Only required as an option.

Input

any

A non-specific parameter that is required for certain changes. If "Add" is chosen for the parameter Operation, this parameter requires the element that is to be inserted into the array. Only required as an option.

Return value

Type

Description

Array

The modified array.

NuGet package: Beckhoff.TwinCAT.HMI.Plastic.Functions

Available: from version 12.12.0

Usage: TC3 Plastic Application HMI projects