*variables=varlist("PV_NO_SCRATCH");
cases=:from n:first,"%s>0"/by n:step,"%s>0"/ *to n:last,"%s>0";
+format=numbering:numbered/!unnumbered,
- wrap:!wrap/single,
- weight:weight/!noweight.
+ wrap:!wrap/single.
*/
/* (declarations) */
/* (functions) */
cmd.step = 1;
}
- /* Weighting variable. */
- if (cmd.weight == LST_WEIGHT)
- {
- if (dict_get_weight (dict) != NULL)
- {
- size_t i;
-
- for (i = 0; i < cmd.n_variables; i++)
- if (cmd.v_variables[i] == dict_get_weight (dict))
- break;
- if (i >= cmd.n_variables)
- {
- /* Add the weight variable to the end of the variable list. */
- cmd.n_variables++;
- cmd.v_variables = xnrealloc (cmd.v_variables, cmd.n_variables,
- sizeof *cmd.v_variables);
- cmd.v_variables[cmd.n_variables - 1]
- = dict_get_weight (dict);
- }
- }
- else
- msg (SW, _("`/FORMAT WEIGHT' specified, but weighting is not on."));
- }
-
/* Case number. */
if (cmd.numbering == LST_NUMBERED)
{
casenum_var = var_create ("Case#", 0);
var_set_both_formats (casenum_var, &format);
- /* Add the weight variable at the beginning of the variable list. */
+ /* Add the case-number variable at the beginning of the variable list. */
cmd.n_variables++;
cmd.v_variables = xnrealloc (cmd.v_variables,
cmd.n_variables, sizeof *cmd.v_variables);
const struct dataset *ds, struct ll_list *targets)
{
struct dictionary *dict = dataset_dict (ds);
+ const char *encoding = dict_get_encoding (dict);
struct list_target *target;
ll_for_each (target, struct list_target, ll, targets)
const struct variable *v = cmd.v_variables[column];
const struct fmt_spec *print = var_get_print_format (v);
int width;
+ char *s;
if (target->type == 0 && column >= target->n_vertical)
{
if (width > print->w)
ds_put_char_multiple(&line_buffer, ' ', width - print->w);
- if (fmt_is_string (print->type)
- || dict_contains_var (dict, v))
- {
- data_out (case_data (c, v), print,
- ds_put_uninit (&line_buffer, print->w));
- }
+ if (fmt_is_string (print->type) || dict_contains_var (dict, v))
+ s = data_out (case_data (c, v), encoding, print);
else
{
union value case_idx_value;
case_idx_value.f = case_idx;
- data_out (&case_idx_value, print,
- ds_put_uninit (&line_buffer,print->w));
+ s = data_out (&case_idx_value, encoding, print);
}
+ ds_put_cstr (&line_buffer, s);
+ free (s);
ds_put_char(&line_buffer, ' ');
}
{
const struct variable *v = cmd.v_variables[column];
const struct fmt_spec *print = var_get_print_format (v);
- char buf[256];
+ char *s;
if (fmt_is_string (print->type)
|| dict_contains_var (dict, v))
- data_out (case_data (c, v), print, buf);
+ s = data_out (case_data (c, v), encoding, print);
else
{
union value case_idx_value;
case_idx_value.f = case_idx;
- data_out (&case_idx_value, print, buf);
+ s = data_out (&case_idx_value, encoding, print);
}
fputs (" <TD>", x->file);
- html_put_cell_contents (d, TAB_FIX, ss_buffer (buf, print->w));
+ html_put_cell_contents (d, TAB_FIX, ss_cstr (s));
fputs ("</TD>\n", x->file);
+
+ free (s);
}
fputs (" </TR>\n", x->file);