When I create a HTML page from a PB program, I need to change every vowel with accent (in spanish) and every special character, by the HTML value. (Character Entity Reference)
I think HTML isnt related to PB in any way, but you can add
this constants at the top of your project.
Adding standard ASCII chars should be enough, because its
directly related to PB.
But maybe the boss wants to add HTML stuff too... Fred
(The bigger the Residents are, the longer it takes to start the compiler...)
While of course having a resident file containing all that stuff is a solution, the example in a previous reply already showed, that the control character is not the final destination but an intermediate one like in
"text1" + #CR + "text2"
There is also not much advantage of looking up a value in a constant name table compared to an ASCII/UNICODE/HTML table. I would prefer syntactic support for embedding arbitrary hex codes like C does with the "\xHH" syntax. (Whether all that \a, \t, \n special cases are a bonus is another discussion). To ensure downward compatibility a different enhanced text delimiter (at least at the beginning) would be nice, like x", so the example would transform to x"text1\x0Dtext2".
Last edited by guido on Thu Jan 08, 2004 8:44 am, edited 1 time in total.
Full Ack but for the x"", that's some ugly code.
I would prefer compiler directives like CompilerEscapeCharactersOn and CompilerEscapeCharactersOff (default). That should be implemented very easy and fast.