From c9a3c45e44c1c03d13d4eb186e3817bc836f75f8 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 16 Jan 2010 16:06:38 -0800 Subject: [PATCH] LIST: Remove WEIGHT subcommand. This subcommand is not needed for compatibility, and it is not really useful because the case weight can be listed by including the name of the weighting variable on the LIST command. --- doc/data-io.texi | 7 ++----- src/language/data-io/list.q | 29 ++--------------------------- tests/command/list.sh | 2 +- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/doc/data-io.texi b/doc/data-io.texi index 1bad334e..fc521cae 100644 --- a/doc/data-io.texi +++ b/doc/data-io.texi @@ -826,8 +826,7 @@ random variates between 0 and 10. LIST /VARIABLES=var_list /CASES=FROM start_index TO end_index BY incr_index - /FORMAT=@{UNNUMBERED,NUMBERED@} @{WRAP,SINGLE@} - @{NOWEIGHT,WEIGHT@} + /FORMAT=@{UNNUMBERED,NUMBERED@} @{WRAP,SINGLE@} @end display The @cmd{LIST} procedure prints the values of specified variables to the @@ -846,9 +845,7 @@ settings. If CASES is not specified then all cases are printed. The FORMAT subcommand can be used to change the output format. NUMBERED will print case numbers along with each case; UNNUMBERED, the default, causes the case numbers to be omitted. The WRAP and SINGLE settings are -currently not used. WEIGHT will cause case weights to be printed along -with variable values; NOWEIGHT, the default, causes case weights to be -omitted from the output. +currently not used. Case numbers start from 1. They are counted after all transformations have been considered. diff --git a/src/language/data-io/list.q b/src/language/data-io/list.q index 614fa127..871fa69e 100644 --- a/src/language/data-io/list.q +++ b/src/language/data-io/list.q @@ -56,8 +56,7 @@ *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) */ @@ -191,30 +190,6 @@ cmd_list (struct lexer *lexer, struct dataset *ds) 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) { @@ -224,7 +199,7 @@ cmd_list (struct lexer *lexer, struct dataset *ds) 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); diff --git a/tests/command/list.sh b/tests/command/list.sh index 504314a9..57eea9d4 100755 --- a/tests/command/list.sh +++ b/tests/command/list.sh @@ -66,7 +66,7 @@ data list file='$top_srcdir/tests/weighting.data'/AVAR 1-5 BVAR 6-10. weight by BVAR. list. *list /cases=from 5 to 20 by 2 /format numbered. -list /format numbered weight. +list /format numbered. *** Multiple lines. data list file='$top_srcdir/tests/list.data' notable /X000 to X126 1-127. -- 2.30.2