STORE Command

Example   See Also

Stores data to a \variable, to an array, or to an array element.

Syntax

STORE eExpression TO VarNameList | ArrayNameList
-or-

VarName | ArrayName = eExpression

Arguments

eExpression

Specifies an expression whose value is stored to the variable, array, or array element. If the variable doesn't exist, it is created and initialized to eExpression. An array must be previously defined with DIMENSION. STORE replaces the value in an existing variable, array, or array element with the new value.

VarNameList

Specifies a list of variables or array elements to which eExpression is stored. Separate the names or array elements with commas.

ArrayNameList

Specifies a list of names of existing arrays to which eExpression is stored. Separate array names with commas.

STORE initializes every element in the arrays to the specified value if SET COMPATIBLE is OFF. STORE stores the specified value to memory variables of the specified names if SET COMPATIBLE is ON, overwriting any existing arrays that have those names.

Remarks

An alternative to STORE is the equal sign (=) assignment operator. The variable, array, or array element must be on the left side of the equal sign and its value on the right side.

Dates can be stored directly to variables, arrays, or array elements by using braces:

STORE {^1998-12-25} TO gdXMas

For more information about creating Date and DateTime values, see Year 2000 Date Support in Chapter 33, Programming Improvements, in the Programmer’s Guide.

The maximum number of variables or arrays you can create is listed in the System Capacities topic. The limit can be increased or decreased in your Visual FoxPro configuration file. For more information on configuring Visual FoxPro, refer to Chapter 3, Configuring Visual FoxPro, in the Installation Guide.