Previous: Inspecting User-Missing Value Sets, Up: User-Missing Values

These functions modify the contents of `struct missing_values`

objects.

The first set of functions applies to all sets of user-missing values:

— Function: bool **mv_add_value** (`struct missing_values *mv, const union value *value`)

— Function: bool**mv_add_str** (`struct missing_values *mv, const char value`[])

— Function: bool**mv_add_num** (`struct missing_values *mv, double value`)

— Function: bool

— Function: bool

Attempts to add the given discrete

valueto set of user-missing valuesmv.valuemust have the same width asmv. Returns true ifvaluewas successfully added, false if the set could not accept any more discrete values. (Always returns false ifmvis a set of long string user-missing values.)These functions are equivalent, except for the form in which

valueis provided, so you may use whichever function is most convenient.

— Function: void **mv_pop_value** (`struct missing_values *mv, union value *value`)

Removes a discrete value from

mv(which must contain at least one discrete value) and stores it invalue.

— Function: void **mv_replace_value** (`struct missing_values *mv, const union value *value, int index`)

Replaces the discrete value with the given

indexinmv(which must contain at leastindex+ 1 discrete values) withvalue.

The second set of functions applies only to numeric sets of user-missing values:

— Function: bool **mv_add_range** (`struct missing_values *mv, double low, double high`)

Attempts to add a numeric range covering

low...high(inclusive on both ends) tomv, which must be a numeric set of user-missing values. Returns true if the range is successful added, false on failure. Fails ifmvalready contains a range, or ifmvcontains more than one discrete value, or iflow>high.