problem with starting new lines in strings

Posted By: oldschoolj

problem with starting new lines in strings - 09/24/07 11:30

Hi folks,
I can't figure out what I'm doing wrong here..
\n is a line feed so putting it before something should put it on a new line right?
example:
STRING* somestring = "Hello \nand goodbye";

the problem is when I display this it just displays the line with the "\n"

Here is the code:
TEXT* icon_text_stat_0000 = {string = icon_string_stat_0000; font= lucida_console8; layer=4;}

STRING* icon_string_stat_0000 = "blade lvl1 \ndamage 1227 \nspeed 1.8";

It looks like that should work just fine? or not, lol.

so i searched the forums a bit and found I could do this as well:

STRING* icon_string_stat_0000 = "blade lvl1
damage 1227
speed 1.8";

but all that does is display it on one line, and it adds "\n" in front of the words damage, and speed....

Any thoughts?

Thanks!
Posted By: Uhrwerk

Re: problem with starting new lines in strings - 09/24/07 14:15

Try

STRING* icon_string_stat_0000 = str_create("blade lvl1 \ndamage 1227 \nspeed 1.8");
© 2023 lite-C Forums