Data editing > Data-mapped variables > Defining data-mapped variables
 
Defining data-mapped variables
You can define data-mapped variables in two ways:
Using the mapvar variable type
The syntax for this is:
mapvar variable_name [size]
For example:
mapvar my_variable 1
If you define an array of mapvar variables (that is, by specifying a size greater than 1), the actual size of the array is determined by its use and not by the size specified. For example, if you have the question ‘Which colors did you paint the walls of each room’, you can specify an array of rooms as:
mapvar rooms 2
and then refer to:
room(1)$Red$, room(2)$Blue$ ... room(3)$Green$
and so on.
However, defining a size of 1 always defines a single variable.
The s (special) and f (function) options have no meaning and so are not valid for mapvar variables.
Using the *usemap statement to introduce a map file
The syntax for this statement is:
*usemap mapfile_name
For example:
*usemap project.qdi
If you use a *usemap statement to introduce a map file, a variable is automatically defined for each item in the file.
Note Although you can use the same name for a mapvar name or a *usemap file, you cannot use the same name for a data-mapped variable and any other type of variable. For example, you could assign the name preferences to both a data-mapped variable and a map file, but you can not use then use this name for a data, integer or real variable.
See also
Data-mapped variables