2. Language Elements : Variables : Simple Variables : How You Can Use Simple Variables
 
Share this page                  
How You Can Use Simple Variables
To make use of a simple variable, use the variable name. For example, to assign the value of Smith to the person variable, use the following statement:
person = 'Smith';
Individual elements in a reference variable or an array can be simple variables, as shown in the illustration in Variables (see Variables). In this illustration, Film is a reference variable with three attributes. Each of these attributes is a simple variable. Similarly, Movies is an array and each individual element in the array is a simple variable.
In a 4GL script, you can use simple variables as reference or array variable elements in any context that you can use other simple variables, for example:
film.Director = 'Hitchcock';
if movies[].Title = 'ANNIE HALL' then ...
In the first example, film.Director is a simple variable that is an element of a reference variable. In the second, movies[].Title is a simple variable that is an element of an array.
For information about referencing the individual elements in a reference or array variable, see Reference Variables (see Reference Variables) and Dynamic Array Variables (see Dynamic Array Variables).