What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » WLM Plus! Bug Reports » Script Editor Colouring

Script Editor Colouring
Author: Message:
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
O.P. Script Editor Colouring
This a very minor "visual" bug that doesn't affect the function of MP!L at all.

The colouring in the script editor becomes confused when using quotation marks are used in regular expressions. According to MSDN, the quotation mark character in a regular expression is not a special character (but rather a literal character). This means that a quotation mark in a regular expression literally matches a quotation mark, as opposed to a string.

The script editor colouring however gets confused and colours it as the beginning of a string. For example:
code:
Debug.Trace(/"/.test("\""));
The script debugging shows no errors (and displays True), so I'm fairly sure that there's no problem with the syntax.

Thanks for your attention. (Y)
01-01-2007 06:24 AM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: Script Editor Colouring
On the topic of syntax highlighting, block comments (/* */) aren't green. :sad:
01-01-2007 07:45 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Script Editor Colouring
quote:
Originally posted by deAd
On the topic of syntax highlighting, block comments (/* */) aren't green. :sad:
This is known. It is also used by some developpers especially because of that.
.-= A 'frrrrrrrituurrr' for Wacky =-.
01-01-2007 08:08 PM
Profile PM Find Quote Report
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
O.P. RE: Script Editor Colouring
Another script editor colouring bug:
code:
Debug.Trace("\\\"");
It appears that the editor takes the apostrophe as part of the string if there is a backslash before it ("\"" resulting in "), unless there is another backslash before that backslash ("\\" resulting in \). However, as seen above, it doesn't take into account a third back slash ("\\\"" resulting in \").
01-30-2007 11:08 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Script Editor Colouring
quote:
Originally posted by phalanxii
Another script editor colouring bug:
code:
Debug.Trace("\\\"");
It appears that the editor takes the apostrophe as part of the string if there is a backslash before it ("\"" resulting in "), unless there is another backslash before that backslash ("\\" resulting in \). However, as seen above, it doesn't take into account a third back slash ("\\\"" resulting in \").
That is not a bug and is actually as it should be...

Backslashes are special escape characters which tell JScript that a literal character is following. Such an 'escape character' or 'metacharacter' is needed if you want to use special characters like \ and " in a string.

\\ will result in the character \
\" will result in the character "
\n will result in a new line character
\x50 will result in the character with hexadecimal code 0x50
etc...

This is the same in many more languages too...

See JScript documentation.

This post was edited on 01-30-2007 at 11:41 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
01-30-2007 11:35 PM
Profile PM Find Quote Report
ddunk
Veteran Member
*****

Avatar

Posts: 1228
Reputation: 51
35 / Male / Flag
Joined: Mar 2004
RE: Script Editor Colouring
quote:
Originally posted by CookieRevised
quote:
Originally posted by phalanxii
Another script editor colouring bug:
code:
Debug.Trace("\\\"");
It appears that the editor takes the apostrophe as part of the string if there is a backslash before it ("\"" resulting in "), unless there is another backslash before that backslash ("\\" resulting in \). However, as seen above, it doesn't take into account a third back slash ("\\\"" resulting in \").
That is not a bug and is actually as it should be...

Backslashes are special escape characters which tell JScript that a literal character is folowing. Such an 'escape character' is needed if you want to use special characters like \ and " in a string.

\\ will result in the character \
\" will result in the character "
\x50 will result in the character with hexadecimal code 0x50
etc...

This is the same in many more languages too...
In that case, shouldn't it be:

open string (")
escape a \ (\\)
escape a " (\")
close string (")
?

And therefore the original poster is correct in saying there is an error?
01-30-2007 11:39 PM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Script Editor Colouring
quote:
Originally posted by ddunk
In that case, shouldn't it be:

open string (")
escape a \ (\\)
escape a " (\")
close string (")
?

And therefore the original poster is correct in saying there is an error?
It _is _
open string (")
escape a \ (\\)
escape a " (\")
close string (")


There is a coloring error in the editor yes, but there isn't an error in the output or whatever else, which is what I've replied upon because this isn't clear in his post... and apparently also not in my post, sorry...

This post was edited on 01-31-2007 at 12:21 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
01-30-2007 11:43 PM
Profile PM Find Quote Report
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
O.P. RE: Script Editor Colouring
Yes, I was talking strictly about the script colouring. Sorry about any confusion, I just wanted to comment on the nature of the bug.
01-31-2007 04:40 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On