X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-logistic.c;fp=src%2Fui%2Fgui%2Fpsppire-dialog-action-logistic.c;h=0c4dc19cdc27895565b6376c2a30071abf6d5a04;hb=c2d972816fce591524db963390a97ff32d55117c;hp=8640beef9bb3e23f3d22565f6459eb3e0249a381;hpb=cdfb21de2cbbf921b4e1fe0662439da1c460eabc;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-logistic.c b/src/ui/gui/psppire-dialog-action-logistic.c index 8640beef9b..0c4dc19cdc 100644 --- a/src/ui/gui/psppire-dialog-action-logistic.c +++ b/src/ui/gui/psppire-dialog-action-logistic.c @@ -163,10 +163,42 @@ generate_syntax (PsppireDialogAction *a) g_string_append (strx, dep); - g_string_append (strx, " WITH "); + g_string_append (strx, " WITH"); - psppire_var_view_append_names (PSPPIRE_VAR_VIEW (rd->indep_vars), 0, strx); + GSList *vars = psppire_var_view_list_names (PSPPIRE_VAR_VIEW (rd->indep_vars), 0); + GSList *node = vars; + GString *var_names = g_string_new (""); + while (node) + { + g_string_prepend (var_names, var_get_name (node->data)); + g_string_prepend (var_names, " "); + node = node->next; + } + + g_string_append (strx, var_names->str); + g_string_free (var_names, TRUE); + + + GString *categoricals = g_string_new (""); + for (node = vars; node; node = node->next) + { + const struct variable *v = node->data; + enum measure m = var_get_measure (v); + + if (m == MEASURE_NOMINAL || m == MEASURE_ORDINAL || var_is_alpha (v)) + { + g_string_prepend (categoricals, var_get_name (v)); + g_string_prepend (categoricals, " "); + } + } + if (0 != strcmp (categoricals->str, "")) + g_string_prepend (categoricals, "\n\t/CATEGORICAL ="); + + g_string_append (strx, categoricals->str); + g_string_free (categoricals, TRUE); + g_slist_free (vars); + g_string_append (strx, "\n\t/CRITERIA ="); g_string_append_printf (strx, " CUT(%g)", rd->cut_point);