Getting this error involving "SPACE" between worrds

So I have this sentence of dialogue, but when I run it I get an error where the first words of the sentence are quoted space apart by SPACE like this
"Hey___SPACE___stop___SPACE___that"
I can't figure out why.
Here is the actual error
SyntaxError: Unexpected token "Hey___SPACE___stop___SPACE___that"


K.V.

Hello.

It sounds like you have a syntax error in your code or something of that nature. Can you post that bit of code?


msg "Hey___SPACE___stop___SPACE___that"
by chance???
needs to be:
msg ("Hey___SPACE___stop___SPACE___that")
(Hmm... that generates an error right off the bat...)


K.V.

Hello.


This is probably close to what you have, and the quotation marks are the problem:

msg (""Hey stop that"")

...which is the same as:

image

OUTPUT:

Error running script: Error compiling expression '""Hey stop that""': SyntaxError: Unexpected token "Hey___SPACE___stop___SPACE___that"


To print it with the quotation marks:

msg ("\"Hey stop that\"")

...which is the same as:

image

...which is the same as:

image

OUTPUT:

"Hey stop that"


To print it without the quotation marks:

msg ("Hey stop that")

...which is the same as:

image


...which is the same as:

image

OUTPUT:

Hey stop that


Well It's actually part of a split, being the third option so it has no msg attached to that part of the code, I can't understand why it doesn't work I have the same code with different response options on another verb and they work fine
I think I discovered the problem but I can't fix it, the error seems to occur when I have dialogue surrounded in quotation marks in the list. If it remove the quotation marks the script runs normal. But I can't understand why that is because like I said I have the same code in another verb just with different options in the split and one of them has quotation marks and runs just fine. Any ideass?
@K.V.
Well I don't have it (""Stop that"") It's in a split in the middle of the various options so it ("Blah;Blah;"Hey stop that!";Blah;Blah")
and like I said I have that same thing whit different words on the other verb and it runs fine
(edit) I did a little testing on the original script someone gave me to do the function involving the split. In it he uses quotation marks and it runs, but when I enter my own sentance with my own quotation marks I run into the error, I have studied both original script and mine and I can't understand why his works and mine doesn't they seem identical to me
here is the original

this.responses = Split("You knock, but nothing happens;You hear someone moving about inside the house, but they don't answer the door;A voice screams “Go away you little punk!”;You thought you heard someone coming to the door, but it was just the wind;more responses here")

Here is mine with just the quote option modified

this.responses = Split("You knock, but nothing happens;You hear someone moving about inside the house, but they don't answer the door;A man's voice barks out "Get out of here asshole";You thought you heard someone coming to the door, but it was just the wind;more responses here")

What's the difference?


K.V.

Try this:

this.responses = Split("You knock, but nothing happens;You hear someone moving about inside the house, but they don't answer the door;A man's voice barks out \"Get out of here asshole\";You thought you heard someone coming to the door, but it was just the wind;more responses here")

the 'split' takes a String ("BLAH_SEPARATOR_BLAH_SEPARATOR_BLAH", "SEPARATOR") and separates it (making it a List) at the designated/specified separators

Split ("red;blue;yellow", ";")

the string, "red;blue;yellow", becomes: (1) red (2) blue (3) yellow

Split ("redMblueMyellow", "M")

the string, "redMblueMyellow", becomes: (1) red (2) blue (3) yellow


as KV already explained/shown, to put various normally-command symbols into a String (as displayed text, instead of being a command to the coding program), you use the 'escape' symbol '/', followed by (NO space!) the symbol you want to show up in the string

msg ("hi")
// output: hi

// vs

msg ("\"hi\"")
// output: "hi"
Split ("red;blue;yellow", ";")

// the string, "red;blue;yellow", becomes: (1) red (2) blue (3) yellow

// vs

Split ("\"red\";\"blue\";\"yellow\"", ";")

// the string, "\"red\";\"blue\";\"yellow\"", becomes: (1) "red" (2) "blue" (3) "yellow"

https://en.wikipedia.org/wiki/Escape_character

https://docs.python.org/2.0/ref/strings.html (see the table) (Python)
https://docs.oracle.com/javase/tutorial/java/data/characters.html (scroll down a bit to the 'escape sequence' table) (Java)
https://msdn.microsoft.com/en-us/library/6aw8xdf2.aspx (C++)

https://www.w3schools.com/js/js_strings.asp (scroll down and bit and read, for/of/about the use of the escape character/symbol) (JavaScript: JS)


Thanks guys, I tried that and it still didn't work till I realized I was using the backslash by mistake, now it works great. Still don't know why the code the guy gave me worked without the forward slashes but doesn't really matter anyway
Thanks again


K.V.

He doesn't use normal double quotes in that example. He uses these:

“”


Normal double quotes (for comparison):

""


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums