Keep getting "Unexpected symbol near '‚'" error on everything

Hi. I’ve been trying some beginner’s tutorials and I keep getting the error  “Unexpected symbol near ‘‚’”  even when the copy the text into main.lua verbatim. Anyone know how to fix this? Thanks.

You need to post the actual code you’re using (just the lines around the problem to start).  Please click on the <> button in the bar with Bold, Italic, Underline etc. and paste your code in there.

Depending on the tutorial, there maybe extra code as part of the formatting you’re picking up. Also what tutorial are you copying from?

Rob

Hi. Here’s the code posted below. It was the beginning of this tutorial: https://docs.coronalabs.com/guide/start/helloWorld/index.html

 

----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- -- Your code here print( “Hello World” )

Wow. You get an error just using that small snippet of code? It looks right to me…

The code you mention typically means that you forget a single character somewhere, like a quote or bracket, or sometimes and “end” statement, but that’s not the case in the code you posted.

Are you sure you’re working on the right file? Try clearing out all of the contents and only using:

print(nil)

So, no comments or titling your file – main.lua either. Just, the 10 characters above. Does this still yield the error?

What are you using for your text editor? You have special quotes there, almost like you’re using Word.

It’s subtle, but it’s the difference between these:

[lua]print( “Hello World” )[/lua]

[lua]print( “Hello World” )[/lua]

We suggest using Sublime Text 3 for editing your lua files.

Hey. So I just erase all contents of main.lua and type print(nil), right? I did it and there’s no error for print(nil).

I just downloaded and used this and it seems to work. Thanks alot. And thanks for the help, everyone.

What were you using? This is a symptom of trying to use Microsoft Word or some other word processor.

Rob

Good catch by Michael W! :slight_smile:

You need to post the actual code you’re using (just the lines around the problem to start).  Please click on the <> button in the bar with Bold, Italic, Underline etc. and paste your code in there.

Depending on the tutorial, there maybe extra code as part of the formatting you’re picking up. Also what tutorial are you copying from?

Rob

Hi. Here’s the code posted below. It was the beginning of this tutorial: https://docs.coronalabs.com/guide/start/helloWorld/index.html

 

----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- -- Your code here print( “Hello World” )

Wow. You get an error just using that small snippet of code? It looks right to me…

The code you mention typically means that you forget a single character somewhere, like a quote or bracket, or sometimes and “end” statement, but that’s not the case in the code you posted.

Are you sure you’re working on the right file? Try clearing out all of the contents and only using:

print(nil)

So, no comments or titling your file – main.lua either. Just, the 10 characters above. Does this still yield the error?

What are you using for your text editor? You have special quotes there, almost like you’re using Word.

It’s subtle, but it’s the difference between these:

[lua]print( “Hello World” )[/lua]

[lua]print( “Hello World” )[/lua]

We suggest using Sublime Text 3 for editing your lua files.

Hey. So I just erase all contents of main.lua and type print(nil), right? I did it and there’s no error for print(nil).

I just downloaded and used this and it seems to work. Thanks alot. And thanks for the help, everyone.

What were you using? This is a symptom of trying to use Microsoft Word or some other word processor.

Rob

Good catch by Michael W! :slight_smile: