MEMORY
VARIABLE
VARIABLE
The same as in other programming languages. A place to store
a value. A variable may be of different types, including logical,
string, numeric, or date.
stored in RAM is called memory variable.
variable is a temporary location of computer’s . They are
needed in FoxPro programs to store values which can be later
used in calculations or to store results of calculation.
Up to 256 different data items can be stored.
Each variable have a UNIQUE NAME.
memory (i.e. primary memory or RAM), where some data can
be stored.
This variable has a name and its memory location.
Memory variable name may be started with
underscore character
should be maximum of 10 characters in length
spaces are not allowed.
num123
stu_name
1student
_rollno
first name
basic-salary
THERE ARE TWO TYPE OF MEMORY
VARIABLE
1. Simple variable
2. Array variable
Two types of array variable
1. Single dimension
2. Double dimension
SIMPLE VARIABLE
We are create simple variable with
"store" command and "=" sign
STORE command • "=" sign
E.g
• E.g
Store <VALUE> TO <VAR NAME>
• ROLL = 37
• NAME = "CHETAN“
Store 37 to roll : • Date = {DD/MM/YYYY}
numeric type
Store “Chetan” to NAME :
character type
Store ‘patna’ to dist. :
character type
FOXPRO automatically assign which types of
Store date() to cur_date :date type
variable are [Link] don't need to declare which
typr data stored in memory variable
ARRAY VARIABLE
SINGLE DIMENSION
WE ARE CREATING ARRAY VARIABLE where we can store more than one
data item in single dimension
Two Command to create ARRAY variable
1. DIMENSION
2. DECLARE
3.
We can create memory variable With DECLARE AND DIMENSION COMMAND.
CREATE ARRAY VARIABLE
For eg For eg
DIMENSION <VARIABLE DECLARE <VARIABLE NAME>(SIZE)
NAME>(SIZE) DECLARE STUDENT(10)
DIMENSION STUDENT(10)
Store "Name -Chetan" to student(1)
Store "Name -Chetan" to student(1)
Store 37 to student(2)
Store 37 to student(2)
Store 7336 to student(3)
Store 7336 to student(3)
DISPLAY MEMORY VARIABLE
Display memory variable
Command
Display memory like <var name>
E.g DISPLAY MEMORY LIKE Student
ARRAY VARIABLE
DOUBLE DIMENSION