- direction = SRT_ASCEND;
-
- for (i = 0; i < var_cnt; i++)
- if (!case_ordering_add_var (ordering, vars[i], direction))
- msg (SW, _("Variable %s specified twice in sort criteria."),
- var_get_name (vars[i]));
+ direction = SC_ASCEND;
+
+ for (i = prev_var_cnt; i < var_cnt; i++)
+ {
+ const struct variable *var = (*vars)[i];
+ if (!subcase_add_var (ordering, var, direction))
+ msg (SW, _("Variable %s specified twice in sort criteria."),
+ var_get_name (var));
+ }