Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: string highlighting bug  (Read 5882 times)

0 Members and 1 Guest are viewing this topic.

manarius

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 27
  • node it. node it all together my brethren :)
    • View Profile
    • Thats one of our Games :-)
string highlighting bug
« on: April 18, 2008, 05:26:29 PM »

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?
« Last Edit: April 25, 2008, 03:15:39 PM by manarius »
Logged

jbw

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • View Profile
Re: string highlighting bug
« Reply #1 on: April 25, 2008, 12:02:03 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.

The \" sequence is misunderstood by color highlighter as escaped quote. To get rid of annoyning purples I always write such lines as follows:
Code: [Select]
ITEM.SetImage("items\png\"+anythinguseful[i]+".sprite");//"
If the path "items\png\" is used more than once, you can define it as constant named e.g. IPNG, then use:
Code: [Select]
ITEM.SetImage(IPNG+anythinguseful[i]+".sprite");with perfect highlighting.

Logged
 

Page created in 0.024 seconds with 23 queries.