However, if using "FloatToStr" with a destination string[17] then the following hint still occurs (mP PRO v5.00):
1. Apparently FloatToStr still expects a destination string of 23 characters (excluding the trailing zero). According to Janni (see the ref above), max 17 chars should be enough.hint: 3029 1016 Warning: Source size (17) does not match destination size (23) StrngUtils.mpas
2. Also the FloatToStr help stays string[23].
3. Additionally the example in the help shows a (riskfull!!) usage of "string[10]" instead of string[17] (or string[23]):
mE,var ff1, ff2, ff3 : real;
txt : array[10] of char; // <---------------- here !!
...
ff1 := -374.2;
ff2 := 123.456789;
ff3 := 0.000001234;
FloatToStr(ff1, txt); // txt is "-374.20001"
- How many characters are actually needed to hold the result of FloatToStr????
- Could you please adapt the function's header (e.g. replace the string[23] by string[17), and adapt the help?
See also e.g. http://www.mikroe.com/forum/viewtopic.php?f=86&t=28133 which suggests that 10 chars should be enough???
Also valid for dsPIC30/33 and PIC24 compiler (and possibly for others too).
Thanks in advance!