MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / ShowParseExpression

Function ShowParseExpression

express.cpp:2685–2702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2683// Parse an arbitrary integer or real expression, and display its result.
2684
2685flag 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.

Callers 1

FProcessSwitchesFunction · 0.85

Calls 4

FCreateTriesFunction · 0.85
GetParameterFunction · 0.85
FormatRFunction · 0.85
PrintNoticeFunction · 0.85

Tested by

no test coverage detected