- int i;
-
- /* Maximum number of digits in a number to add to the base
- vecname. */
- int ndig;
-
- /* Name of an individual variable to be created. */
- char name[SHORT_NAME_LEN + 1];
-
- /* Vector variables. */
- struct variable **v;
- int nv;
-
- if (!lex_force_int ())
- return CMD_CASCADING_FAILURE;
- nv = lex_integer ();
- lex_get ();
- if (nv <= 0)
- {
- msg (SE, _("Vectors must have at least one element."));
- goto fail;
- }
- if (!lex_force_match (')'))
- goto fail;
-
- /* First check that all the generated variable names
- are LONG_NAME_LEN characters or shorter. */
- ndig = intlog10 (nv);
- for (cp = vecnames; *cp;)
- {
- int len = strlen (cp);
- if (len + ndig > LONG_NAME_LEN)
- {
- msg (SE, _("%s%d is too long for a variable name."), cp, nv);
- goto fail;
- }
- cp += len + 1;
- }
-
- /* Next check that none of the variables exist. */
- for (cp = vecnames; *cp;)
+ /* Short form. */
+ struct fmt_spec format;
+ bool seen_format = false;
+
+ struct variable **vars;
+ int var_cnt;
+
+ size_t i;
+
+ var_cnt = 0;
+ format = fmt_for_output (FMT_F, 8, 2);
+ seen_format = false;
+ while (!lex_match (lexer, T_RPAREN))
+ {
+ if (lex_is_integer (lexer) && var_cnt == 0)
+ {
+ var_cnt = lex_integer (lexer);
+ lex_get (lexer);
+ if (var_cnt <= 0)
+ {
+ msg (SE, _("Vectors must have at least one element."));
+ goto fail;
+ }
+ }
+ else if (lex_token (lexer) == T_ID && !seen_format)
+ {
+ seen_format = true;
+ if (!parse_format_specifier (lexer, &format)
+ || !fmt_check_output (&format)
+ || !fmt_check_type_compat (&format, VAL_NUMERIC))
+ goto fail;
+ }
+ else
+ {
+ lex_error (lexer, NULL);
+ goto fail;
+ }
+ lex_match (lexer, T_COMMA);
+ }
+ if (var_cnt == 0)
+ {
+ lex_error (lexer, _("expecting vector length"));
+ goto fail;
+ }
+
+ /* Check that none of the variables exist and that their names are
+ not excessively long. */
+ for (i = 0; i < vector_cnt; i++)