GET DATA TXT: change syntax generation from /IMPORTCASES to IMPORTCASE
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 18 Jul 2015 07:59:32 +0000 (09:59 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 18 Jul 2015 07:59:32 +0000 (09:59 +0200)
Apparently, spss only accepts IMPORTCASE (contrary to its documentation).

Reported by: Frans Houweling

src/ui/gui/page-intro.c
tests/language/data-io/get-data-txt.at

index a7cda1b2208c7043a1d089c8b0cfc1152adfd5dd..6db2bee688ffe6fe2b73461a2682ef8e674ae991 100644 (file)
@@ -186,11 +186,11 @@ void
 intro_append_syntax (const struct intro_page *p, struct string *s)
 {
   if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (p->n_cases_button)))
-    ds_put_format (s, "  /IMPORTCASES=FIRST %d\n",
+    ds_put_format (s, "  /IMPORTCASE=FIRST %d\n",
                   gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (p->n_cases_spin)));
   else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (p->percent_button)))
-    ds_put_format (s, "  /IMPORTCASES=PERCENT %d\n",
+    ds_put_format (s, "  /IMPORTCASE=PERCENT %d\n",
                   gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (p->percent_spin)));
   else
-    ds_put_cstr (s, "  /IMPORTCASES=ALL\n");
+    ds_put_cstr (s, "  /IMPORTCASE=ALL\n");
 }
index f18fc978f8e04dab509cf0d30f8ec0c47ef415f9..60409df37e74abd59e74f905fb7ed3b9af76b578 100644 (file)
@@ -286,7 +286,7 @@ Gilly     ,. ,White,10.04.2007,10.00,"3""   ",Guinea Pig
 AT_CLEANUP
 dnl " (fixes Emacs highlighting)
 
-AT_SETUP([GET DATA /TYPE=TXT with IMPORTCASES])
+AT_SETUP([GET DATA /TYPE=TXT with IMPORTCASE])
 AT_CHECK([$PERL > test.data <<'EOF'
 for ($i = 1; $i <= 100; $i++) {
     printf "%02d\n", $i;
@@ -294,19 +294,19 @@ for ($i = 1; $i <= 100; $i++) {
 EOF
 ])
 AT_DATA([get-data.sps], [dnl
-get data /type=txt /file='test.data' /importcases=first 10 /variables x f8.0.
+get data /type=txt /file='test.data' /importcase=first 10 /variables x f8.0.
 list.
 
-get data /type=txt /file='test.data' /importcases=percent 1 /variables x f8.0.
+get data /type=txt /file='test.data' /importcase=percent 1 /variables x f8.0.
 list.
 
-get data /type=txt /file='test.data' /importcases=percent 35 /variables x f8.0.
+get data /type=txt /file='test.data' /importcase=percent 35 /variables x f8.0.
 list.
 
-get data /type=txt /file='test.data' /importcases=percent 95 /variables x f8.0.
+get data /type=txt /file='test.data' /importcase=percent 95 /variables x f8.0.
 list.
 
-get data /type=txt /file='test.data' /importcases=percent 100 /variables x f8.0.
+get data /type=txt /file='test.data' /importcase=percent 100 /variables x f8.0.
 list.
 ])
 AT_CHECK([pspp -o pspp.csv get-data.sps])