Change explicit variable name checks into use of dict_class_from_id().
[pspp] / src / weight.c
index 642a2b736fdd69b304d56c4ac163400b39b8bdcd..41dc33f65562becfde277be97d86165e320a50e1 100644 (file)
 #include "str.h"
 #include "var.h"
 
-/* Notes:
-
-   If the weighting variable is deleted somehow (for instance by
-   end-of-scope of TEMPORARY), weighting must be canceled.
-
-   Scratch vars may not be used for weighting. */
-
 /* WEIGHT transformation. */
 struct weight_trns
   {
@@ -61,7 +54,7 @@ cmd_weight (void)
          msg (SE, _("The weighting variable must be numeric."));
          return CMD_FAILURE;
        }
-      if (v->name[0] == '#')
+      if (dict_class_from_id (v->name) == DC_SCRATCH)
        {
          msg (SE, _("The weighting variable may not be scratch."));
          return CMD_FAILURE;