Read From Array

 

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

 

Properties

 

Option

Description

Array

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

Position

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

First

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

Last

Reads the last value in the array.

At Index

Reads 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) from which to read 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 locating 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 reads the third value (C) in the array.

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

Value

Enter a string variable to store the read 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 found at the specified array location.

Not Found

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

Error

This is taken if an error has occurred.