IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 24, 2005, 3:44:00 PM (21 years ago)
Author:
eugene
Message:

allow quoted strings in math

File:
1 edited

Legend:

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

    r3029 r3318  
    11161116  char line[512];
    11171117
     1118  /* evaluate stack will only call WW_binary with one numerical value,
     1119     and only in the case that the string did not parse to a number
     1120     thus: string == number -> false */
     1121  if (!strncasecmp (&V1[0].type, "S", 1)) {
     1122    value = (op[0] == 'N');
     1123    goto escape;
     1124  }
     1125  if (!strncasecmp (&V2[0].type, "S", 1)) {
     1126    value = (op[0] == 'N');
     1127    goto escape;
     1128  }
     1129
    11181130  switch (op[0]) {
    11191131  case 'E':
     
    11241136    break;
    11251137  default:
    1126     sprintf (line, "error: op %c not defined!", op[0]);
     1138    sprintf (line, "error: op %c not defined for string operations!", op[0]);
    11271139    push_error (line);
    11281140    return (FALSE);
    11291141  }
    11301142
     1143escape:
    11311144  strcpy (OUT[0].name, "tmp");
    11321145  OUT[0].Float = value;
Note: See TracChangeset for help on using the changeset viewer.