Eliminated global variable current_dataset.
[pspp-builds.git] / src / language / expressions / operations.def
index dbd5ce2b2e688a3ea8269acbd8de8fd4d199d94a..e1ae2a531e49cd34f6275637d25872fd5a15d372 100644 (file)
@@ -957,8 +957,9 @@ no_opt string operator STR_VAR ()
 }
 
 no_opt perm_only function LAG (num_var v, pos_int n_before)
+    dataset ds;
 {
-  struct ccase *c = lagged_case (current_dataset, n_before);
+  struct ccase *c = lagged_case (ds, n_before);
   if (c != NULL)
     {
       double x = case_num (c, v->fv);
@@ -969,8 +970,9 @@ no_opt perm_only function LAG (num_var v, pos_int n_before)
 }
 
 no_opt perm_only function LAG (num_var v)
+    dataset ds;
 {
-  struct ccase *c = lagged_case (current_dataset, 1);
+  struct ccase *c = lagged_case (ds, 1);
   if (c != NULL)
     {
       double x = case_num (c, v->fv);
@@ -982,8 +984,9 @@ no_opt perm_only function LAG (num_var v)
 
 no_opt perm_only string function LAG (str_var v, pos_int n_before)
      expression e;
+     dataset ds;
 {
-  struct ccase *c = lagged_case (current_dataset, n_before);
+  struct ccase *c = lagged_case (ds, n_before);
   if (c != NULL)
     return copy_string (e, case_str (c, v->fv), v->width);
   else
@@ -992,8 +995,9 @@ no_opt perm_only string function LAG (str_var v, pos_int n_before)
 
 no_opt perm_only string function LAG (str_var v)
      expression e;
+     dataset ds;
 {
-  struct ccase *c = lagged_case (current_dataset, 1);
+  struct ccase *c = lagged_case (ds, 1);
   if (c != NULL)
     return copy_string (e, case_str (c, v->fv), v->width);
   else