summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
79100bd)
Thanks to Paul Vella, Alan Mead, and Bastián Díaz for helping with this.
- sys_warn (r, 0, _("Invalid role for variable %s."),
+ sys_warn (r, -1, _("Invalid role for variable %s."),
- sys_warn (r, 0, _("%zu other variables had invalid roles."),
+ sys_warn (r, -1, _("%zu other variables had invalid roles."),
type = val_type_from_width (width);
v->alignment = var_default_alignment (type);
v->measure = var_default_measure (type);
type = val_type_from_width (width);
v->alignment = var_default_alignment (type);
v->measure = var_default_measure (type);
v->display_width = var_default_display_width (width);
v->print = v->write = var_default_formats (width);
attrset_init (&v->attributes);
v->display_width = var_default_display_width (width);
v->print = v->write = var_default_formats (width);
attrset_init (&v->attributes);
- case ROLE_NONE:
- return _("None");
-
case ROLE_INPUT:
return _("Input");
case ROLE_INPUT:
return _("Input");
case ROLE_BOTH:
return _("Both");
case ROLE_BOTH:
return _("Both");
+ case ROLE_NONE:
+ return _("None");
+
case ROLE_PARTITION:
return _("Partition");
case ROLE_PARTITION:
return _("Partition");
- case ROLE_NONE:
- return "NONE";
-
case ROLE_INPUT:
return "INPUT";
case ROLE_INPUT:
return "INPUT";
case ROLE_BOTH:
return "BOTH";
case ROLE_BOTH:
return "BOTH";
+ case ROLE_NONE:
+ return "NONE";
+
case ROLE_PARTITION:
return "PARTITION";
case ROLE_PARTITION:
return "PARTITION";
/* Intended usage of a variable, for populating dialogs. */
enum var_role
{
/* Intended usage of a variable, for populating dialogs. */
enum var_role
{
ROLE_INPUT,
ROLE_OUTPUT,
ROLE_BOTH,
ROLE_INPUT,
ROLE_OUTPUT,
ROLE_BOTH,
ROLE_PARTITION,
ROLE_SPLIT
};
ROLE_PARTITION,
ROLE_SPLIT
};
measure_to_string (var_get_measure (v)));
r++;
measure_to_string (var_get_measure (v)));
r++;
+ if (role != ROLE_INPUT)
{
tab_joint_text_format (t, 1, r, 2, r, TAB_LEFT,
_("Role: %s"), var_role_to_string (role));
{
tab_joint_text_format (t, 1, r, 2, r, TAB_LEFT,
_("Role: %s"), var_role_to_string (role));
else if ( lex_match_id (lexer, "SPLIT"))
role = ROLE_SPLIT;
else
else if ( lex_match_id (lexer, "SPLIT"))
role = ROLE_SPLIT;
else
+ {
+ lex_error (lexer, NULL);
+ return CMD_FAILURE;
+ }
if (!parse_variables (lexer, dataset_dict (ds), &v, &nv, PV_NONE))
return CMD_FAILURE;
if (!parse_variables (lexer, dataset_dict (ds), &v, &nv, PV_NONE))
return CMD_FAILURE;
- if (!strcmp (new_text, var_role_to_string (ROLE_NONE)))
- var_set_role (var, ROLE_NONE);
- else if (!strcmp (new_text, var_role_to_string (ROLE_INPUT)))
+ if (!strcmp (new_text, var_role_to_string (ROLE_INPUT)))
var_set_role (var, ROLE_INPUT);
else if (!strcmp (new_text, var_role_to_string (ROLE_OUTPUT)))
var_set_role (var, ROLE_OUTPUT);
else if (!strcmp (new_text, var_role_to_string (ROLE_BOTH)))
var_set_role (var, ROLE_BOTH);
var_set_role (var, ROLE_INPUT);
else if (!strcmp (new_text, var_role_to_string (ROLE_OUTPUT)))
var_set_role (var, ROLE_OUTPUT);
else if (!strcmp (new_text, var_role_to_string (ROLE_BOTH)))
var_set_role (var, ROLE_BOTH);
+ else if (!strcmp (new_text, var_role_to_string (ROLE_NONE)))
+ var_set_role (var, ROLE_NONE);
else if (!strcmp (new_text, var_role_to_string (ROLE_PARTITION)))
var_set_role (var, ROLE_PARTITION);
else if (!strcmp (new_text, var_role_to_string (ROLE_SPLIT)))
else if (!strcmp (new_text, var_role_to_string (ROLE_PARTITION)))
var_set_role (var, ROLE_PARTITION);
else if (!strcmp (new_text, var_role_to_string (ROLE_SPLIT)))
column, cell, render_var_cell, obj, NULL);
add_combo_column (obj, VS_ROLE, _("Role"), 12,
column, cell, render_var_cell, obj, NULL);
add_combo_column (obj, VS_ROLE, _("Role"), 12,
- var_role_to_string (ROLE_NONE), ROLE_NONE,
var_role_to_string (ROLE_INPUT), ROLE_INPUT,
var_role_to_string (ROLE_OUTPUT), ROLE_OUTPUT,
var_role_to_string (ROLE_BOTH), ROLE_BOTH,
var_role_to_string (ROLE_INPUT), ROLE_INPUT,
var_role_to_string (ROLE_OUTPUT), ROLE_OUTPUT,
var_role_to_string (ROLE_BOTH), ROLE_BOTH,
+ var_role_to_string (ROLE_NONE), ROLE_NONE,
var_role_to_string (ROLE_PARTITION), ROLE_PARTITION,
var_role_to_string (ROLE_SPLIT), ROLE_SPLIT,
NULL);
var_role_to_string (ROLE_PARTITION), ROLE_PARTITION,
var_role_to_string (ROLE_SPLIT), ROLE_SPLIT,
NULL);
if (measure != var_default_measure (type))
syntax_gen_pspp (s, "VARIABLE LEVEL %ss (%ss).\n",
name, measure_to_syntax (measure));
if (measure != var_default_measure (type))
syntax_gen_pspp (s, "VARIABLE LEVEL %ss (%ss).\n",
name, measure_to_syntax (measure));
+ if (role != ROLE_INPUT)
syntax_gen_pspp (s, "VARIABLE ROLE /%ss %ss.\n",
var_role_to_syntax (role), name);
if (alignment != var_default_alignment (type))
syntax_gen_pspp (s, "VARIABLE ROLE /%ss %ss.\n",
var_role_to_syntax (role), name);
if (alignment != var_default_alignment (type))
AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0],
[[Variable,Description,,Position
FirstVariable,Format: F8.0,,1
AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0],
[[Variable,Description,,Position
FirstVariable,Format: F8.0,,1
,Custom attributes:,,
,adèle[1],23,
,adèle[2],34,
,Custom attributes:,,
,adèle[1],23,
,adèle[2],34,
VARIABLE ALIGNMENT x (LEFT)/y (RIGHT)/z (CENTER).
VARIABLE WIDTH x (10)/y (12)/z (14).
VARIABLE LEVEL x (SCALE)/y (ORDINAL)/z (NOMINAL).
VARIABLE ALIGNMENT x (LEFT)/y (RIGHT)/z (CENTER).
VARIABLE WIDTH x (10)/y (12)/z (14).
VARIABLE LEVEL x (SCALE)/y (ORDINAL)/z (NOMINAL).
-VARIABLE ROLE /INPUT x /TARGET y /BOTH z.
+VARIABLE ROLE /TARGET x /BOTH y /NONE z.
DISPLAY DICTIONARY.
])
AT_CHECK([pspp -o pspp.csv var-display.sps])
DISPLAY DICTIONARY.
])
AT_CHECK([pspp -o pspp.csv var-display.sps])
Variable,Description,,Position
x,Format: F8.2,,1
,Measure: Scale,,
Variable,Description,,Position
x,Format: F8.2,,1
,Measure: Scale,,
,Display Alignment: Left,,
,Display Width: 10,,
y,Format: F8.2,,2
,Measure: Ordinal,,
,Display Alignment: Left,,
,Display Width: 10,,
y,Format: F8.2,,2
,Measure: Ordinal,,
,Display Alignment: Right,,
,Display Width: 12,,
z,Format: F8.2,,3
,Measure: Nominal,,
,Display Alignment: Right,,
,Display Width: 12,,
z,Format: F8.2,,3
,Measure: Nominal,,
,Display Alignment: Center,,
,Display Width: 14,,
])
,Display Alignment: Center,,
,Display Width: 14,,
])