Arrays

Arrays are sequences of numeric variables or of string variables (each is an element of the array), in which each element is identified by number. The first element is element number 1 (not element number 0, as in C language). Arrays are the easiest way to write code in which the variable affected varies depending on a counting number.

A BASIC program creates an array with the  statement. Certain BASIC statements that return multiple values can create arrays to hold the values. Others require that the array already exist.

When you create a string array, elements that are not yet assigned a value have the value of the empty string. When you create a numeric array, elements that are not yet assigned a value have the value of 0.

The name of an array can be the name of a numeric variable (such as ), in which every element is a numeric value; or a string variable (such as  ), in which every element is a string value.
 * Syntax

The simplest array is an array of one dimension (a vector or linear array). If the variable A is a linear array of ten elements, its elements are referenced as  through. The number inside the brackets is called the index and specifies the array element to be used. The index does not have to be a numeric constant, but can be any numeric expression. The expression  operates on a different element depending on the value of.

A two-dimensional array (a matrix) can be imagined as a table. All references to this array have two indexes. The first might be the row in the table and the second might be the column. So  might represent information in the table's third row, fifth column.

When an RFO-BASIC! program creates an array, BASIC obtains memory from the Android device, sufficient to store each element, plus a bookkeeping area in which BASIC remembers the size of the array. There is no limit on the number of dimensions a BASIC array can have, nor on the number of elements in each dimension. The only inherent limitation on the size of an array is the available memory of the Android device.
 * Implementation