| 2683 | // Parse an arbitrary integer or real expression, and display its result. |
| 2684 | |
| 2685 | flag ShowParseExpression(CONST char *sz) |
| 2686 | { |
| 2687 | PAR par = {0, 0.0, fFalse}; // If parsing fails, assume 0. |
| 2688 | char szMsg[cchSzMax], szNum[cchSzDef]; |
| 2689 | |
| 2690 | // Ensure the lookup tables have been created. |
| 2691 | if (us.fNoExp || (xi.rgsTrieFun == NULL && !FCreateTries())) |
| 2692 | return fFalse; |
| 2693 | |
| 2694 | GetParameter(sz, &par); |
| 2695 | if (!par.fReal) |
| 2696 | sprintf(szNum, "%d", par.n); |
| 2697 | else |
| 2698 | FormatR(szNum, par.r, 6); |
| 2699 | sprintf(szMsg, "Expression returned: %s\n", szNum); |
| 2700 | PrintNotice(szMsg); |
| 2701 | return fTrue; |
| 2702 | } |
| 2703 | |
| 2704 | |
| 2705 | // Get a parameter in integer format. |
no test coverage detected