Hello,
In the docs for gauge_calculator_code_precompile()
it says:
A precompiled (compressed) calculator string can be used as input to the
execute_calculator_code
andformat_calculator_string
functions.
And indeed it works with any code destined for execute_calculator_code()
.
However when I give it "formatting" code meant for format_calculator_string()
, it reports errors (below). The same code string works w/out error when passed directly to format_calculator_string()
, w/out going through the precompile stage.
Using a simple example from the RPN string formatting docs:
Fuel Quantity: %( (A:FUEL TOTAL QUANTITY, liters) )%!1.2f!
When passed directly to format_calculator_string()
it yields the expected result:
Fuel Capacity: 336.90
When passed to gauge_calculator_code_precompile()
it throws errors in the Dev Mode Console:
Invalid script (command not found - perhaps a space is missing or there's an extra space?): "Fuel" Invalid script (no command is more than 4 characters): "Quantity: ( (A:FUEL TOTAL QUANTITY, liters) )!1.2f!" Invalid script (no command is more than 4 characters): "( (A:FUEL TOTAL QUANTITY, liters) )!1.2f!"
Which BTW are the same errors I'd see if I passed that calculator string to execute_calculator_code()
directly.
FWIW, gauge_calculator_code_precompile()
returns ok/true when this happens, a compiled size (pCompiledSize) of 11 and the byte code returned is 01:0B:00:00:00:00:00:00:00:00:00. (which clearly format_calculator_string()
doesn't know what to do with and just returns the byte code data verbatim).
Is there some trick to pre-compiling string formatting code for use in format_calculator_string()
? Or does it simply not work?
Thank you,
-Max