FREQUENCIES: Accept (but ignore) ORDER subcommand.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 7 Mar 2015 07:47:36 +0000 (23:47 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 7 Mar 2015 07:47:36 +0000 (23:47 -0800)
Allows syntax generated by SPSS to work.

Reported by Tom Smekens.

doc/statistics.texi
src/language/stats/frequencies.c
tests/language/stats/frequencies.at

index d2dd0d63bd31d847398d4cd33eea55bb87403f52..d333de1db24acf10050b413ff000fc063f31f97c 100644 (file)
@@ -138,6 +138,7 @@ FREQUENCIES
                   [@{FREQ,PERCENT@}] [@{NOMISSING,MISSING@}]
         /BARCHART=[MINIMUM(@var{x_min})] [MAXIMUM(@var{x_max})]
                   [@{FREQ,PERCENT@}]
+        /ORDER=@{ANALYSIS,VARIABLE@}
 
 
 (These options are not currently implemented.)
@@ -230,6 +231,8 @@ percentages.
 The @subcmd{FREQ} and @subcmd{PERCENT} options on @subcmd{HISTOGRAM} and 
 @subcmd{PIECHART} are accepted but not currently honoured.
 
+The @subcmd{ORDER} subcommand is accepted but ignored.
+
 @node EXAMINE
 @section EXAMINE
 
index aa4eddfacc7831a9b8fab226f75f28e02a6b477a..cd131f514b29afc3c2cdfdcc16bda2f5a882b2f7 100644 (file)
@@ -1072,6 +1072,12 @@ cmd_frequencies (struct lexer *lexer, struct dataset *ds)
                 }
             }
         }
+      else if (lex_match_id (lexer, "ORDER"))
+        {
+          lex_match (lexer, T_EQUALS);
+          if (!lex_match_id (lexer, "ANALYSIS"))
+            lex_match_id (lexer, "VARIABLE");
+        }
       else
         {
           lex_error (lexer, NULL);
index 25e8e2fe4420ee5a73bab0e0845d1a291dbc905d..ff54e8e9cf1b56a32c14356abadd09f02dc80405 100644 (file)
@@ -18,7 +18,7 @@ quux 5 8
 END DATA.
 EXECUTE.
 
-FREQUENCIES /VAR = name.
+FREQUENCIES /VAR = name/ORDER=ANALYSIS.
 ])
 AT_CHECK([pspp -O format=csv frequencies.sps], [0], [dnl
 Table: name
@@ -43,7 +43,7 @@ begin data.
 3 4
 end data.
 
-frequencies v1 v2/statistics=none.
+frequencies v1 v2/statistics=none/ORDER=VARIABLE.
 frequencies v1 v2/statistics=none.
 ])
 AT_CHECK([pspp -O format=csv frequencies.sps], [0],