|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Mon Aug 30, 2010 9:13 pm
#PRINT and using special characters |
Okay up until now the following worked just fine:
Code: |
#print {<color maroon> |%repeat("=", 12)|</color>} |
It would print out:
However, now it prints out as the following:
So I tried this:
Code: |
#print {<color maroon> ~|%repeat("=", 12)~|</color>} |
and it printed out correctly as:
What changed here and is there now a problem with adding "|" in a #print statement? Perhaps I should have done this differently or used %concat but it always worked before and saved writing extra code for a %concat. Escaping them isn't a big deal either, but I am not sure why it would interpret the pipe character like that.
Edit: Also the first quotation mark is not colored maroon while the rest is. What I found is that if you escape only one of the | characters it will print correctly. It doesn't matter which one. However, if you don't escape either one of them it prints it out partially colored with quotation marks on the screen. |
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Mon Aug 30, 2010 9:26 pm |
I'm just going to use %concat instead like I probably should have done in the first place but I thought it was interesting.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Aug 30, 2010 10:18 pm |
It's because the | character within {} is reserved for creating string lists now. You can either use ~ before the | like you did, or put " around the | like this:
Code: |
#print {<color maroon> "|"%repeat("=", 12)"|"</color>} |
|
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Tue Aug 31, 2010 9:21 am |
Yeah I figured that out after posting.
|
|
|
|
|
|