execute_calculator_code

The execute_calculator_code function evaluates a coded calculator string.

 

Syntax
BOOL execute_calculator_code(
    PCSTRINGZ  code,
    FLOAT64*  fvalue,
    SINT32*  ivalue,
    PCSTRINGZ*  svalue
    );

 

Members
Parameters Description
code Specifies the calculator code.
fvalue Pointer to a float. Returns the result of the calculation, if it is a floating point value.
ivalue Pointer to an integer. Returns the result of the calculation, if it is an integer value.
svalue Pointer to a string. Returns the result of the calculation, if it is a string.

Return Values

If the function succeeds, it returns a non-zero value. If it fails, it returns zero.

 

Example
FLOAT64 att_pitch = 0;
FLOAT64 att_bank = 0;
execute_calculator_code ("(A:ATTITUDE INDICATOR PITCH DEGREES:2, degrees)", &att_pitch, NULL, NULL);
execute_calculator_code ("(A:ATTITUDE INDICATOR BANK DEGREES:2, degrees)", &att_bank, NULL, NULL);

 

Remarks

It is worth noting that, unlike when creating XML gauges, calculator symbols should be written correctly and not using codes. For example, the following XML:

(>K:TOGGLE_ICS)

would be written as:

(>K:TOGGLE_ICS)

So, things like &gt;, &lt;, &amp;, etc... should always be written as <, >, and &, etc...

 

See Also