/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <stdio.h>
#include <math.h>
-#include "data/procedure.h"
+#include "data/dataset.h"
#include "data/variable.h"
#include "language/command.h"
#include "language/lexer/lexer.h"
lex_get (lexer);
if (!lex_force_match_id (lexer, "FROM"))
return CMD_FAILURE;
- if (!lex_force_int (lexer))
+ if (!lex_force_int_range (lexer, "FROM", a + 1, INT_MAX))
return CMD_FAILURE;
b = lex_integer (lexer);
- if (a >= b)
- {
- msg (SE, _("Cannot sample %d observations from a population of "
- "%d."),
- a, b);
- return CMD_FAILURE;
- }
-
frac = 0;
}
lex_get (lexer);
trns->frac = frac;
add_transformation (ds, sample_trns_proc, sample_trns_free, trns);
- return lex_end_of_command (lexer);
+ return CMD_SUCCESS;
}
/* Executes a SAMPLE transformation. */