ldries46
unread,Feb 2, 2012, 9:13:35 AM2/2/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
In C/C++ the possibility exists to write to a string.
Is there something like that in ADA?
I want to write several floating and fixed point parameters to a string with
each a dedicated but different number of digits behind the decimal point.
for instance a= 4.10 b= 5.2 c=7.123
In C/C++ it can be done by sprintf("a= %.2f b=%.1f c=%.3f",a,b,c);
I have seen that in Ada writing to a file or a device it can also be done
with the PUT precedure from Text-IO but I cannot find the way to use PUT for
outputing to a string.
I possibility that crossed my mind is using the Fixed point types but
converting the floating point values to fixed point values in a way that I
can use a temporary type declared like:
type number is delta fix_p(after) range <>;
where fix_p is an array (0.1, 0.01, 0.001) and after is 1, 2 or 3 doesnot
seem to work because fix_p(after) is not static.
How can I reach my objective or should I completely write it myself?
L. Dries