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?