HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

weird string behavior (bug?)

10-05-2004, 02:12 AM#1
curi
the following breaks the WE jass parser:

cust script: local string s = "ljsdf\sdf\wer\wer"

to make it break, use 3 or more total backslashes, and fail to exclusively use them in pairs (next to each other).

this is bad b/c it means you can't have a function that takes a long path using single slashes (say to a special effect), then uses string manipulation to double them for the user.
10-05-2004, 03:01 AM#2
fugly
but one way or another a string can only hold 1024 chars, so whats the problem? and "\" is reserved i beileve for something so \\ are ALWAYS used. I don't see the bug sorry.
10-05-2004, 03:04 AM#3
curi
you need to use \\ when calling blizzard functions like to display text or create a special effect, but you should be able to hold any string in a string variable.
10-05-2004, 10:53 AM#4
AIAndy
Escape sequences (backslash + something) are resolved during the parsing of the script. Internally there is no \\ or similar in the strings.
10-05-2004, 04:06 PM#5
curi
do you know why 1 or 2 single backslashes is OK, but not 3+ ? and no singles if you have an escaped one anywhere.
10-05-2004, 07:21 PM#6
AIAndy
When you insert a \ then the next character counts. Only specific such escape sequences are allowed, numbers do not matter.