1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
3 Written by John Darrington <john@darrington.wattle.id.au>
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., 51 Franklin Street, Fifth Floor, Boston, MA
30 #include "debug-print.h"
32 /* Set variables' alignment
33 This is the alignment for GUI display only.
34 It affects nothing but GUIs
37 cmd_variable_alignment (void)
48 if (!parse_variables (default_dict, &v, &nv, PV_NONE))
49 return CMD_PART_SUCCESS_MAYBE;
51 if ( lex_force_match('(') )
53 if ( lex_match_id("LEFT"))
55 else if ( lex_match_id("RIGHT"))
57 else if ( lex_match_id("CENTER"))
73 for( i = 0 ; i < nv ; ++i )
74 v[i]->alignment = align;
86 /* Set variables' display width.
87 This is the width for GUI display only.
88 It affects nothing but GUIs
91 cmd_variable_width (void)
99 if (!parse_variables (default_dict, &v, &nv, PV_NONE))
100 return CMD_PART_SUCCESS_MAYBE;
102 if ( lex_force_match('(') )
104 if ( lex_force_int())
108 lex_force_match(')');
111 for( i = 0 ; i < nv ; ++i )
112 v[i]->display_width = tokval;
119 while (token != '.');
123 /* Set variables' measurement level */
125 cmd_variable_level (void)
134 if (!parse_variables (default_dict, &v, &nv, PV_NONE))
135 return CMD_PART_SUCCESS_MAYBE;
137 if ( lex_force_match('(') )
139 if ( lex_match_id("SCALE"))
140 level = MEASURE_SCALE;
141 else if ( lex_match_id("ORDINAL"))
142 level = MEASURE_ORDINAL;
143 else if ( lex_match_id("NOMINAL"))
144 level = MEASURE_NOMINAL;
151 lex_force_match(')');
159 for( i = 0 ; i < nv ; ++i )
160 v[i]->measure = level ;
168 while (token != '.');