APPLY DICTIONARY: Style improvements.
[pspp] / src / language / dictionary / delete-variables.c
index ded5c48ad3c99829db7a8735a432a0a8cffd47f4..1063b1652e6abe0b549162f5ad40f31b1f28d5e4 100644 (file)
@@ -22,6 +22,7 @@
 #include "data/dataset.h"
 #include "data/dictionary.h"
 #include "language/command.h"
+#include "language/lexer/lexer.h"
 #include "language/lexer/variable-parser.h"
 #include "libpspp/message.h"
 
@@ -33,17 +34,18 @@ int
 cmd_delete_variables (struct lexer *lexer, struct dataset *ds)
 {
   struct variable **vars;
-  size_t var_cnt;
+  size_t n_vars;
   bool ok;
 
   if (proc_make_temporary_transformations_permanent (ds))
-    msg (SE, _("%s may not be used after %s.  "
-               "Temporary transformations will be made permanent."),
-        "DELETE VARIABLES", "TEMPORARY");
+    lex_ofs_error (lexer, 0, lex_ofs (lexer) - 1,
+                   _("%s may not be used after %s.  "
+                     "Temporary transformations will be made permanent."),
+                   "DELETE VARIABLES", "TEMPORARY");
 
-  if (!parse_variables (lexer, dataset_dict (ds), &vars, &var_cnt, PV_NONE))
+  if (!parse_variables (lexer, dataset_dict (ds), &vars, &n_vars, PV_NONE))
     goto error;
-  if (var_cnt == dict_get_var_cnt (dataset_dict (ds)))
+  if (n_vars == dict_get_n_vars (dataset_dict (ds)))
     {
       msg (SE, _("%s may not be used to delete all variables "
                  "from the active dataset dictionary.  "
@@ -56,7 +58,7 @@ cmd_delete_variables (struct lexer *lexer, struct dataset *ds)
   if (!ok)
     goto error;
 
-  dict_delete_vars (dataset_dict (ds), vars, var_cnt);
+  dict_delete_vars (dataset_dict (ds), vars, n_vars);
 
   /* XXX A bunch of bugs conspire to make executing transformations again here
      necessary, even though it shouldn't be.