/[pspp]/pspp/src/print.c
ViewVC logotype

Diff of /pspp/src/print.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by blp, Mon Jan 24 07:05:36 2005 UTC revision 1.17 by blp, Tue Mar 1 08:16:15 2005 UTC
# Line 27  Line 27 
27  #include "command.h"  #include "command.h"
28  #include "dfm-write.h"  #include "dfm-write.h"
29  #include "error.h"  #include "error.h"
30  #include "expr.h"  #include "expressions/public.h"
31  #include "file-handle.h"  #include "file-handle.h"
32  #include "lexer.h"  #include "lexer.h"
33  #include "misc.h"  #include "misc.h"
# Line 599  fixed_parse_compatible (void) Line 599  fixed_parse_compatible (void)
599    
600    dividend = (fx.lc - fx.fc + 1) / fx.nv;    dividend = (fx.lc - fx.fc + 1) / fx.nv;
601    fx.spec.u.v.f.w = dividend;    fx.spec.u.v.f.w = dividend;
602    if (!check_output_specifier (&fx.spec.u.v.f))    if (!check_output_specifier (&fx.spec.u.v.f, 1))
603      return 0;      return 0;
604    if ((type == ALPHA) ^ (formats[fx.spec.u.v.f.type].cat & FCAT_STRING))    if ((type == ALPHA) ^ (formats[fx.spec.u.v.f.type].cat & FCAT_STRING))
605      {      {
# Line 748  fixed_parse_fortran (void) Line 748  fixed_parse_fortran (void)
748          }          }
749        else if (lex_match ('/'))        else if (lex_match ('/'))
750          fl->f.type = FMT_NEWREC;          fl->f.type = FMT_NEWREC;
751        else if (!parse_format_specifier (&fl->f, 1)        else if (!parse_format_specifier (&fl->f, FMTP_ALLOW_XT)
752                 || !check_output_specifier (&fl->f))                 || !check_output_specifier (&fl->f, 1))
753          goto fail;          goto fail;
754    
755        lex_match (',');        lex_match (',');
# Line 1041  cmd_print_space (void) Line 1041  cmd_print_space (void)
1041    
1042    if (token != '.')    if (token != '.')
1043      {      {
1044        e = expr_parse (EXPR_NUMERIC);        e = expr_parse (default_dict, EXPR_NUMBER);
1045        if (token != '.')        if (token != '.')
1046          {          {
1047            expr_free (e);            expr_free (e);
# Line 1082  print_space_trns_proc (struct trns_heade Line 1082  print_space_trns_proc (struct trns_heade
1082                         int case_num UNUSED)                         int case_num UNUSED)
1083  {  {
1084    struct print_space_trns *t = (struct print_space_trns *) trns;    struct print_space_trns *t = (struct print_space_trns *) trns;
1085    int n;    double n = 1.;
1086    
1087    if (t->e)    if (t->e)
1088      {      {
1089        union value v;        n = expr_evaluate_num (t->e, c, case_num);
1090          if (n == SYSMIS)
1091        expr_evaluate (t->e, c, case_num, &v);          msg (SW, _("The expression on PRINT SPACE evaluated to the "
1092        n = v.f;                     "system-missing value."));
1093        if (n < 0)        else if (n < 0)
1094          {          msg (SW, _("The expression on PRINT SPACE evaluated to %g."), n);
1095            msg (SW, _("The expression on PRINT SPACE evaluated to %d.  It's "        n = 1.;
                      "not possible to PRINT SPACE a negative number of "  
                      "lines."),  
                n);  
           n = 1;  
         }  
1096      }      }
   else  
     n = 1;  
1097    
1098    if (t->writer == NULL)    if (t->writer == NULL)
1099      while (n--)      while (n--)

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26