Bug #48763.
Changes from 0.10.2 to 0.10.4:
- * Gtk+3.14.5 or later must now be used when building.
+ * Gtk+3.14.5 or later must now be used when building.
- * The AUTORECODE command now accepts an optional / before INTO.
+ * The AUTORECODE command now accepts an optional / before INTO.
+
+ * The short form of the VECTOR command can now create string variables.
Changes from 0.10.1 to 0.10.2:
To make a vector out of a set of existing variables, specify a name
for the vector followed by an equals sign (@samp{=}) and the variables
-to put in the vector. All the variables in the vector must be the same
-type. String variables in a vector must all have the same width.
+to put in the vector. The variables must be all numeric or all
+string, and string variables must have the same width.
To make a vector and create variables at the same time, specify one or
-more vector names followed by a count in parentheses. This will cause
-variables named @code{@var{vec}1} through @code{@var{vec}@var{count}}
-to be created as numeric variables. By default, the new variables
-have print and write format F8.2, but an alternate format may be
-specified inside the parentheses before or after the count and
-separated from it by white space or a comma. Variable names including
-numeric suffixes may not exceed 64 characters in length, and none of
-the variables may exist prior to @cmd{VECTOR}.
+more vector names followed by a count in parentheses. This will
+create variables named @code{@var{vec}1} through
+@code{@var{vec}@var{count}}. By default, the new variables are
+numeric with format F8.2, but an alternate format may be specified
+inside the parentheses before or after the count and separated from it
+by white space or a comma. With a string format such as A8, the
+variables will be string variables; with a numeric format, they will
+be numeric. Variable names including the suffixes may not exceed 64
+characters in length, and none of the variables may exist prior to
+@cmd{VECTOR}.
Vectors created with @cmd{VECTOR} disappear after any procedure or
procedure-like command is executed. The variables contained in the
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2010, 2011, 2012, 2016 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
{
seen_format = true;
if (!parse_format_specifier (lexer, &format)
- || !fmt_check_output (&format)
- || !fmt_check_type_compat (&format, VAL_NUMERIC))
+ || !fmt_check_output (&format))
goto fail;
}
else
for (j = 0; j < var_cnt; j++)
{
char *name = xasprintf ("%s%d", vectors[i], j + 1);
- vars[j] = dict_create_var_assert (dict, name, 0);
+ vars[j] = dict_create_var_assert (dict, name,
+ fmt_var_width (&format));
var_set_both_formats (vars[j], &format);
free (name);
}
AT_SETUP([VECTOR short form with format specification])
AT_DATA([vector.sps], [dnl
data list notable/x 1.
-vector #vec(4, comma10.2).
+vector #vec(4, comma10.2)
+ /#svec(3, a8).
display vector.
])
AT_CHECK([pspp -o pspp.csv vector.sps])
,2,#vec2,COMMA10.2
,3,#vec3,COMMA10.2
,4,#vec4,COMMA10.2
+#svec,1,#svec1,A8
+,2,#svec2,A8
+,3,#svec3,A8
])
AT_CLEANUP