22 |
#include "command.h" |
#include "command.h" |
23 |
#include "dictionary.h" |
#include "dictionary.h" |
24 |
#include "error.h" |
#include "error.h" |
25 |
#include "expr.h" |
#include "expressions/public.h" |
26 |
#include "lexer.h" |
#include "lexer.h" |
27 |
#include "str.h" |
#include "str.h" |
28 |
#include "var.h" |
#include "var.h" |
44 |
struct expression *e; |
struct expression *e; |
45 |
struct select_if_trns *t; |
struct select_if_trns *t; |
46 |
|
|
47 |
e = expr_parse (EXPR_BOOLEAN); |
e = expr_parse (default_dict, EXPR_BOOLEAN); |
48 |
if (!e) |
if (!e) |
49 |
return CMD_FAILURE; |
return CMD_FAILURE; |
50 |
|
|
66 |
|
|
67 |
/* Performs the SELECT IF transformation T on case C. */ |
/* Performs the SELECT IF transformation T on case C. */ |
68 |
static int |
static int |
69 |
select_if_proc (struct trns_header * t, struct ccase * c, |
select_if_proc (struct trns_header *t_, struct ccase *c, |
70 |
int case_num) |
int case_num) |
71 |
{ |
{ |
72 |
return (expr_evaluate (((struct select_if_trns *) t)->e, c, |
struct select_if_trns *t = (struct select_if_trns *) t_; |
73 |
case_num, NULL) == 1.0) - 2; |
return expr_evaluate_num (t->e, c, case_num) == 1.0 ? -1 : -2; |
74 |
} |
} |
75 |
|
|
76 |
/* Frees SELECT IF transformation T. */ |
/* Frees SELECT IF transformation T. */ |
121 |
{ |
{ |
122 |
struct expression *e; |
struct expression *e; |
123 |
|
|
124 |
e = expr_parse (EXPR_BOOLEAN); |
e = expr_parse (default_dict, EXPR_BOOLEAN); |
125 |
if (!e) |
if (!e) |
126 |
return CMD_FAILURE; |
return CMD_FAILURE; |
127 |
|
|