Hi Richard, all,

2009/9/12 Richard <[email protected]>:
>>
>> What I don't understand is why we would split the formatting and the
>> output. What is the advantage over adding the device parameter to
>> format_word_dec() and call format_print() (well... _format_print() )
>> from format_word_dec()?
>
> Personally the idea is that format only deals with formats and if you
> want to print the format you use print_format() which sold be added to
> the print library so print deals with the output as it should.
> It could be interesting to split a value into separate figures ascii
> or real for instance to send to a 7 segment display or other
> applications.
Okay, I understand.
I think it is a real but rare requirement. We could handle this in
different ways:

1- As you describe: format puts the output in a buffer and a user
always calls a function to output this buffer to a device. This means
most user have to make two calls.
(2- To make the output-call optional included with the format call.
This means most users will save a call, but all users must specify a
(dummy) device.)
3- To always call the output function. When you don't want the output,
pass a dummy var. Also, documenten how to access the formatted string.

When I wrote the three options above, I realised that the 2nd one is
not add much to the third one - it only saves a few bytes of program
memory.

I'd like to hear what option people on this list prefer...

>> I don't know how we could do this. Each procedure could of course
>> indicate what the buffersize required is. But that would also include
>> the procedures that are not used and will be optimised away...
>
> Yes I know,  I was just hoping it would be possible in a way.
>
>>
>> I think the user will need to specify a constant for the largest
>> 'class' used (or size of the buffer) before the include statement.
>> This constant (directly or indirectly) defines the buffer size and
>> enables all procedures that operate on that buffer size.
>
> I guess this is the only solution to the above problem although I
> rather limit the amount of user defined constants.
>
I can't think of an alternative now, buy maybe someone has a better
idea how to determine a buffer length, based on functions actually
*used*??

> Ok, but do you and the others like the concept or should we only
> modify format that it’s the same as the print lib but with the
> addition of controlling the format?
Do I understand correct that the difference is formatting or
formatting + output? If so, I repeated your question since I'd like
the opinion from others on this. If not, please tell me what I missed.

Joep

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to