1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
3 Written by Ben Pfaff <blp@gnu.org>.
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
31 /*#define DEBUGGING 1*/
32 #include "debug-print.h"
35 static void debug_print (void);
39 cmd_variable_labels (void)
46 lex_match_id ("VARIABLE");
47 lex_match_id ("LABELS");
51 parse_variables (NULL, &v, &nv, PV_NONE);
53 if (token != T_STRING)
55 msg (SE, _("String expected for variable label."));
57 return CMD_PART_SUCCESS_MAYBE;
59 if (ds_length (&tokstr) > 120)
61 msg (SW, _("Truncating variable label to 120 characters."));
62 ds_truncate (&tokstr, 120);
64 for (i = 0; i < nv; i++)
68 v[i]->label = xstrdup (ds_value (&tokstr));
89 printf (_("Variable labels:\n"));
90 for (i = 0; i < nvar; i++)
92 printf (" %8s: ", var[i]->name);
94 printf ("`%s'", var[i]->label);
96 printf (_("(no variable label)"));
100 #endif /* DEBUGGING */