Wintermute Engine > Bug reports
string highlighting bug
(1/1)
manarius:
i know its not important, cause there seem to be no player-felt bugs because of this,
and i think you know it already,
but its kind of disturbing if you encounter it the first time:
if you write for example:
ITEM.SetImage("items\png\"+anythinguseful+".sprite");
the highlighting ist completely screwed, ".sprite" is black, while the rest is grey and the engine makes that purple bar which indicates script errors.
as i said, its not anyway relevant for the player, its just a bit confusing for me.
cheers,
manarius
ps:
i think its because of the \ in the string?
jbw:
--- Quote from: manarius on April 18, 2008, 05:26:29 PM ---ITEM.SetImage("items\png\"+anythinguseful+".sprite");
the highlighting ist completely screwed, ".sprite" is black, while the rest is grey and the engine makes that purple bar which indicates script errors.
--- End quote ---
The \" sequence is misunderstood by color highlighter as escaped quote. To get rid of annoyning purples I always write such lines as follows:
--- Code: ---ITEM.SetImage("items\png\"+anythinguseful[i]+".sprite");//"
--- End code ---
If the path "items\png\" is used more than once, you can define it as constant named e.g. IPNG, then use:
--- Code: ---ITEM.SetImage(IPNG+anythinguseful[i]+".sprite");
--- End code ---
with perfect highlighting.
Navigation
[0] Message Index
Go to full version