IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 23, 2004, 7:36:01 AM (22 years ago)
Author:
eugene
Message:

fixed dvomath for strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c

    r2792 r2801  
    55 
    66  int i, j, Nvar, Nout, status;
     7  char line[512];
    78  StackVar tmp_stack;
    89  Nout = Nvar = 0;
     
    2627      return (TRUE);
    2728    }
    28     push_error ("syntax error!");
     29    push_error ("syntax error: not a math expression");
    2930    free (tmp_stack.name);
    3031    return (FALSE);
     
    5051
    5152      if (i < 2) {  /* need two variables to operate on */
    52         fprintf (stderr, "syntax error\n");
     53        sprintf (line, "syntax error: binary operator with one operand: %s\n", stack[i].name);
     54        push_error (line);
    5355        free (tmp_stack.name);
    5456        return (FALSE);
     
    123125
    124126      if (i < 1) {  /* need one variable to operate on */
    125         fprintf (stderr, "syntax error\n");
     127        push_error ("syntax error: unary operator with no operand");
    126128        free (tmp_stack.name);
    127129        return (FALSE);
     
    137139      /* there are no valid unary string operators */
    138140      if (!strncasecmp (&stack[i - 1].type, "W", 1)) {
    139         fprintf (stderr, "syntax error\n");
     141        push_error ("syntax error: no valid string unary ops");
    140142        free (tmp_stack.name);
    141143        return (FALSE);
     
    156158
    157159  if (*Nstack > 1) {
    158     fprintf (stderr, "syntax error\n");
     160    push_error ("syntax error in evaluation");
    159161    return (FALSE);
    160162  }
Note: See TracChangeset for help on using the changeset viewer.