lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Enrico Colombini wrote:
Your other option is to use some type of markup and do post processing on the strings.

Yes, of course, but that's just a way to program around the 'long constant
string' issue :-)
The same problem arises when defining strings that must be aligned in some
way. For example, while programming in C for a 16x2 LCD display, I can
format my code just as the user will see it [better read with a monospaced
font]:

 char errmsg[] = "Unknown error   "
                 "don't do that!  ";

That's very useful for catching mis-alignments in the source code.

I don't agree-- it's not just a way to program around the constant string issue. It also provides a way to include any necessary format information. Even an LCD display might have features such as reverse or blinking. Furthermore, hard-coding the display size into the source code is not good programming practice. To be flexible, you'd have to run the text through a wrapping function anyway.

-John


--
http:// i      .   /