-/* Parse CROSSBREAK subcommand. */
-static int
-mns_custom_crossbreak (struct cmd_means *cmd)
-{
- return mns_custom_tables (cmd);
-}
-
-/* Parses the VARIABLES subcommand. */
-static int
-mns_custom_variables (struct cmd_means *cmd)
-{
- if (cmd->sbc_tables)
- {
- msg (SE, _("VARIABLES must precede TABLES."));
- return 0;
- }
-
- if (cmd->sbc_variables == 1)
- {
- int i;
-
- for (i = 0; i < dict_get_var_cnt (default_dict); i++)
- dict_get_var (default_dict, i)->p.mns.min = SYSMIS;
- }
-
- do
- {
- int orig_n = n_var;
-
- double min, max;
-
- if (!parse_variables (default_dict, &v_var, &n_var,
- PV_APPEND | PV_NO_DUPLICATE | PV_NO_SCRATCH))
- return 0;
-
- if (!lex_force_match ('('))
- return 0;
-
- /* Lower value. */
- if (token == T_ID
- && (!strcmp (tokid, "LO") || lex_id_match ("LOWEST", tokid)))
- min = LOWEST;
- else
- {
- if (!lex_force_num ())
- return 0;
- min = tokval;
- }
- lex_get ();
-
- lex_match (',');
-
- /* Higher value. */
- if (token == T_ID
- && (!strcmp (tokid, "HI") || lex_id_match ("HIGHEST", tokid)))
- max = HIGHEST;
- else
- {
- if (!lex_force_num ())
- return 0;
- max = tokval;
- }
- lex_get ();
-
- if (!lex_force_match (')'))
- return 0;
-
- /* Range check. */
- if (max < min)
- {
- msg (SE, _("Upper value (%g) is less than lower value "
- "(%g) on VARIABLES subcommand."), max, min);
- return 0;
- }
-
- {
- int i;
-
- for (i = orig_n; i < n_var; i++)
- {
- struct means_proc *v_inf = &v_var[i]->p.mns;
-
- v_inf->min = min;
- v_inf->max = max;
- }
- }
- }
- while (token != '/' && token != '.');
-
- return 1;
-}
-
-#if DEBUGGING
-static void
-debug_print (struct cmd_means *cmd)
-{
- int i;
-
- printf ("MEANS");
-
- if (cmd->sbc_variables)
- {
- int j = 0;
-
- printf (" VARIABLES=");
- for (i = 0; i < default_dict.nvar; i++)
- {
- struct variable *v = default_dict.var[i];
-
- if (v->p.mns.min == SYSMIS)
- continue;
- if (j++)
- printf (" ");
- printf ("%s(", v->name);
- if (v->p.mns.min == LOWEST)
- printf ("LO");
- else
- printf ("%g", v->p.mns.min);
- printf (",");
- if (v->p.mns.max == HIGHEST)
- printf ("HI");
- else
- printf ("%g", v->p.mns.max);
- printf (")");
- }
- printf ("\n");
- }
-
- printf (" TABLES=");
- for (i = 0; i < n_dim; i++)
- {
- int j;
-
- if (i)
- printf (" BY");
-
- for (j = 0; j < nv_dim[i]; j++)
- {
- if (i || j)
- printf (" ");
- printf (v_dim[i][j]->name);
- }
- }
- printf ("\n");
-}
-#endif /* DEBUGGING */
-