Update Array

 

Replaces a single data value at the specified location in an array variable with another value.

 

Properties

 

Option

Description

Array

Enter the array variable containing the array in which you want to update a value.

Position

Select the array position at which you want to update a value:

First

Updates the first value in the array (at the index position of 0).

Last

(Default) Updates the last value in the array.

At Index

Updates the value at the index position specified in the Index property.

Index

If you selected the 'At Index' option for the Position property, enter the index location (as a literal value or an integer variable) at which you want to update the value. For a maximum permitted array length of 50 values, the index must be in the range -50 and 49. A minus value counts backwards from the end of the array and facilitates updating values that are near the end of the array.

As an example, in an array containing 5 values, the indexing is as shown below:

 

 

 

 

 

 

Index

0

1

2

3

4

 

-5

-4

-3

-2

-1

Array

Value A

Value B

Value C

Value D

Value E

 

Specifying an index of 2 or -3 updates value C with another value (say, X) to give the following array:

 

 

 

 

 

 

Index

0

1

2

3

4

 

-5

-4

-3

-2

-1

Array

Value A

Value B

Value X

Value D

Value E

Note: if you provide an index that exceeds the number of values in the array, then no update takes place.

Update Value

Enter the value that should overwrite the current value (a literal value or a variable matching the data type of the array).

Note: a date value must be provided as a variable and not as a literal.

Exit Points

Exit Point

Description

Complete

This is taken if a value was updated at the specified index location.

Not Found

This is taken if the specified index location did not exist.

Error

This is taken if an error has occurred.