Next: , Previous: , Up: Basic Concepts   [Contents][Index]

2.4 Value Labels

Each variable has a set of value labels (see VALUE LABELS in PSPP Users Guide), represented as struct val_labs. A struct val_labs is essentially a map from union values to strings. All of the values in a set of value labels have the same width, which for a set of value labels owned by a variable (the common case) is the same as its variable.

Sets of value labels may contain any number of entries.

It is rarely necessary to interact directly with a struct val_labs object. Instead, the most common operation, looking up the label for a value of a given variable, can be conveniently executed through functions on struct variable. See Variable Value Labels, for details.

Function prototypes and other declarations related to missing values are declared in data/value-labels.h.

Structure: struct val_labs

Opaque type that represents a set of value labels.

The most often useful function for value labels is val_labs_find, for looking up the label associated with a value.

Function: char * val_labs_find (const struct val_labs *val_labs, union value value)

Looks in val_labs for a label for the given value. Returns the label, if one is found, or a null pointer otherwise.

Several other functions for working with value labels are described in the following section, but these are more rarely useful.

Next: , Previous: , Up: Basic Concepts   [Contents][Index]