Variables Examples

The following examples are simple assignment statements that are functionally equivalent.

STORE 7 TO nVar
nVar = 7

The following example uses a variable, nInc, to hold the value of a loop counter. Visual FoxPro assigns a new value to the variable during each loop.

FOR nInc = 1 TO 10
   ? nInc
ENDFOR

The following example uses a variable, cName, to hold the value of the Firstname field from the Customer table.

USE Customer
STORE Customer.Firstname TO cName