#### Choose

##### Choose(Integer, Array)

Returns a value from the array based on the value of Integer. For example, if integer is 0, it returns the first element in the array, and if index is 1 it returns the second element in the array.

Parameters

- Integer - A Number or numeric expression that specifies the index of the element. The minimum value is 0, and the maximum is the number of available elements minus 1. If it is out of bounds, no value will be returned.
- Array - An array that contains all the available elements to choose from. All elements must be of the same type. A choice can be any simple type (Number, Currency, String, Boolean, Date, Time or DateTime), or range type (Number Range, Currency Range, String Range, Date Range, Time Range or DateTime Range), but it may not be an array.

Return value

A value from the element in the given array. The type of the returned value is the same as the type of the element.

Examples

- `Choose(1,["Poor","Fair","Good","Excellent"])` - Returns Fair.
- `Choose(2,["1 to 10","11 to 20", "21 to 30"])` - Returns 21 to 30.
- `Choose(2,[1,2,3,4,5,6])` - Returns 3.
- `Choose(2,[Todate('1998/5/4'),ToDate('1999/5/5'),ToDate('1996/5/6')])` - Returns 5/6/96.