Hi Richard, 2009/9/11 Richard <[email protected]>: > > Hoi guys, > > > I want to start again with de format library, but before creating a > library nobody is interested in, I would like to discus how to > continue. Think before you act. Very wise indeed.
> My idea is to add to print.jal functions like print_date and > print_time en create a format lib only dealing with format. > Now print.jal and format.jal are almost the same, what can be very > confusing. Iirc you stated the difference quite clear yourself: format.jal allows you to control the way the output looks. So the number of chars used, fixed-point format etc. > About format I would like to assign a global array called digit[] as > big as the amount off digits of the biggest variable + 2 (- sign and > decimal point). > For word variable this is 7 but for dword this is 12 > for example: format_word_dec (variable , amount of digit numbers, > amount of digits behind the point) > > so format_word_dec(125,4,2) should result in digit[0] = “1”, digit[1] > = “.” digit[2] = “2”, digit[3] = “5” and digit[4] till digit[11] = > “NUL” > > format_word_dec(2346,5,0) should result in digit[0] = “0”, digit[1] = > “2” digit[2] = “3”, digit[3] = “4”, digit[4] = “6” and digit[5] till > digit[11] = “NUL” > > > format_word_dec(5678,3,0) should result in digit[0] = “*”, digit[1] = > “*” digit[2] = “*”,and digit[3] till digit[11] = “NUL” > > with format_print (device) we can send the array digit[] fully or > partly (until variable has value “NUL”) to the selected device. It might be a good idea to have an array to store the intermediate result, I don't know... 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()? > It would be nice if we can (re)assign the digit[] array in a procedure > or function so that we can limiting the amount off used memory. > In that case the digit[] array must be as big as variable “amount of > digit numbers” or if variable “amount of digit numbers” is zero, as > big as the amount of digits of the variable it self. 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... 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. > Anybody an better idea or maybe some more suggestions? See my suggestions (not better idea's). 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 -~----------~----~----~----~------~----~------~--~---
