SetElementByIndex

function SetElementByIndex(ctx: Required<TcHmi.Context>, arraySymbol: TcHmi.Symbol<any[]> | null, arrayIndex: number | null, value: any): void

The function SetElementByIndex sets the value of a certain array index in a binding.

Parameter

Name

Type

Description

ctx

Required<TcHmi.Context>

Context object

Does not need to be specified by the user when used in a trigger or function expression. In this case the transfer and the evaluation is done by the corresponding parser.

Is used by the caller to indicate success or failure to the framework during execution.

If the function is used directly in JavaScript/TypeScript, the context object must be passed in the call and evaluated if necessary.

arraySymbol

Symbol

A binding to the symbol of an array.

index

number

The index of the array for which the value is to be set.

value

any

The value to be written in the position of the array.

Return value

Type

Description

void

No return value.

NuGet package: Beckhoff.TwinCAT.HMI.Functions

SetElementByIndex 1:

NuGet packages are available from version 1.12.

SetElementByIndex 2:

Available from 1.8