Hi William et al, I gave this some thought. String is mostly used to print constants. In the less-common cases where it is used for printing a variable string, it is likely that the var string itself is longer than the text to be printed. Hence, early termination on a 0 (or 255) is logical most cases so it should be the default behavior. However, I do see your point of providing the dump function, regardless of the content. So what about changing the behaviour to terminate on 0, optionally on an other char and optionally, disable this behavior?
Joep 2010/5/3 William <[email protected]>: > Greetings Joep, > > On May 2, 4:06 pm, [email protected] wrote: >> Log: disable end-of-string detection to avoid the >> bug...http://code.google.com/p/jallib/source/detail?r=2009 >> > > Thank you, that will work for now. What about a slightly different > approach, that would allow anyone who wants to test/debug the new > feature, yet not break older code: > > 1) delete these lines completely (do not define a default terminator > at all): > if (defined(print_string_terminator) == false) then > const byte print_string_terminator = 0 > end if > > 2) modify the other lines like so: > if (defined(print_string_terminator) == true) then > if (str[i] == print_string_terminator) then exit loop > end if > end if > > William > > -- > 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. > > -- 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.
