Remove From Array

 

Removes a single data value from a specified location in an array variable and then optionally stores it for use elsewhere.

 

Properties

 

Option

Description

Array

Enter the array variable containing the array from which you want to remove the value.

Position

Select the array position from which you want to remove the value:

First

(Default) Removes the first value from the array (at the index position of 0) shifting all current values down by one index position.

Last

Removes the last value from the array (at the index position of -1).

At Index

Removes the value at the index position specified in the Index property shifting all higher indexed values down by one index position.

Index

If you selected the 'At Index' option for the Position property, enter the index location (as a literal value or an integer variable) from which to remove 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 removing 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 removes the value C to give the following shorter array in which some of the indexes now refer to different values.

 

 

 

 

 

Index

0

1

2

3

 

-4

-3

-2

-1

Array

Value A

Value B

Value D

Value E

Note: if you provide an index that exceeds the number of values in the array, then execution continues along the Not Found exit point.

Value

(Optional) Enter a string variable to store the removed value. The variable type must match the data type of the array.

Exit Points

Exit Point

Description

Complete

This is taken if a value was removed from 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.