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., 59 Temple Place - Suite 330, 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"))
65 for( i = 0 ; i < nv ; ++i )
66 v[i]->alignment = align;
78 /* Set variables' display width.
79 This is the width for GUI display only.
80 It affects nothing but GUIs
83 cmd_variable_width (void)
91 if (!parse_variables (default_dict, &v, &nv, PV_NONE))
92 return CMD_PART_SUCCESS_MAYBE;
94 if ( lex_force_match('(') )
100 lex_force_match(')');
103 for( i = 0 ; i < nv ; ++i )
104 v[i]->display_width = tokval;
111 while (token != '.');
115 /* Set variables' measurement level */
117 cmd_variable_level (void)
126 if (!parse_variables (default_dict, &v, &nv, PV_NONE))
127 return CMD_PART_SUCCESS_MAYBE;
129 if ( lex_force_match('(') )
131 if ( lex_match_id("SCALE"))
132 level = MEASURE_SCALE;
133 else if ( lex_match_id("ORDINAL"))
134 level = MEASURE_ORDINAL;
135 else if ( lex_match_id("NOMINAL"))
136 level = MEASURE_NOMINAL;
140 lex_force_match(')');
143 for( i = 0 ; i < nv ; ++i )
144 v[i]->measure = level ;
152 while (token != '.');