line breaks in strings
bergedorfcacher
09 Jul 2016, 16:04Hi,
I found out that \n or \n\r will not work in strings. < br/ > does work seemingly. Is it ok to use that or will I run into trouble further ahead?
XanMag
09 Jul 2016, 17:01Using <br/>
has always worked for me. I'm a code noob but I don't anticipate any problems using that. I have used it quite a bit and in a lot of different places within script, so... I think you're good to go.
Although I won't be surprised if some code maven comes along and corrects me! :)
hegemonkhan
09 Jul 2016, 19:18I too could be wrong, but I believe this is how quest has been programmed. The 'escape' character in quest is mainly used to tell quest to display the double quote in the outputted string, I don't think quest really has the 'escape' character coded to be used for much else, unlike what it's used for in the main languages (newline, etc etc etc). Quest uses the 'br' and other such XML-like tags instead.
I can't remember at the moment if quest's 'escape' character is a forward-slash or a backward-slash (I haven't been using them for awahile in quest), so try using both, and seeing if they work with the 'n' (newline) and/or the double quote.
Watcher55
10 Jul 2016, 02:13If you look at the code produced when you put in a multi-line "message" using the editor, you'll see it uses
(not sure about the spaces), so it is safe to do that.
bergedorfcacher
10 Jul 2016, 08:02Thanks all.
@Watcher55: I inserted the spaces just here in the message, so it displays at all. In code I use it without them.
Jay Nabonne
10 Jul 2016, 15:13Quest output is actual HTML. You can even output things like CSS and script tags. Whatever you'd see in an HTML document (except the HTML and BODY tags, of course).
bergedorfcacher
10 Jul 2016, 15:59Thanks, Jay, good to know. Not that I need anything beyond line breaks at the moment, but who knows what silly ideas I might have in the future.
Jay Nabonne
10 Jul 2016, 17:11Bold, italic, color, font face... the world is your oyster. :)