ArrayAddValue (Method)

Overview

Type:

Method

Available as of:

1.2.3.0

G-SE-0069854.1.gif-high.gif

 

 

Functional Description

Adds a value to an open ARRAY in the STRING that is being processed.

The format of the value added to the STRING depends on the data type of the variable assigned to the input i_anyValue. The assigned value is converted, if required, to an ASCII  STRING and added in the suitable format to the STRING that is being processed.

In contrast to the Methods ArrayAdd<data type> which support only one specific data type for the value, this single method supports several data types for the input i_anyValue.

Variables of data type BOOL, STRING, INT, UINT, DINT, UDINT, BYTE, WORD, DWORD, LWORD, REAL, LREAL, SINT, USINT, LINT, ULINT, TIME, LTIME, DATE_AND_TIME, DATE, and TOD are supported for the input i_anyValue.

The return value is TRUE if the function was executed successfully. Evaluate the property Result, in case the return value is FALSE.

Unsuccessful execution of the method can have the following causes:

Possible Cause

Effect

The present STRING does not contain an open ARRAY.

The STRING remains unchanged.

The maximum length of the present STRING is reached.

The STRING remains unchanged.

The data type (for example ARRAY or WSTRING) of the variable assigned to i_anyValue is not supported.

The STRING remains unchanged.

Interface

Input

Data type

Description

i_anyValue

ANY*

Specifies the value to be added.

* Supported data types are: BOOL, STRING, INT, UINT, DINT, UDINT, BYTE, WORD, DWORD, LWORD, REAL, LREAL, SINT, USINT, LINT, ULINT, TIME, LTIME, DATE_AND_TIME, DATE, and TOD.

Example

Calling the method ArrayAddValue adds the text marked in bold magenta in the example to the STRING:

{"Array":[1,2,<value>}

<value> corresponds to the value specified with the input i_anyValue of the method.