hello world error - unexpected symbol near '{'

im starting to learn lua to create small apps for ipad but im not having sucess even at the first lesson “hello world”…

i copy and paste the code from the tutorial page like bellow:
print( “Hello World” )
but i always get the same error message at the corona terminal:
unexpected symbol near ‘{’
btw im using the default mac os text editor to create this lua file…

any ideas about what is happening here?

thanks :slight_smile: [import]uid: 80175 topic_id: 13205 reply_id: 313205[/import]

Maybe I’m wrong, but try to put an space after the “print”.

print ("Hello World")  

See ya!
[import]uid: 54349 topic_id: 13205 reply_id: 48474[/import]

It sounds like you have a stray { character somewhere in your file. Try deleting your file and starting over and take extra special care not to type in any stray characters. [import]uid: 7563 topic_id: 13205 reply_id: 48477[/import]

leo.artfinal - I think thats not the problem 'cos under corona version for windows it works perfectly for android…

ewing - thats what i thought, but i recreated the file dozen of times and always the same problems happens… i was thinking about the possibility of the MAC OS text editor creating invisible chars at the document…

very strange…

if any one else has a clue…

=/ [import]uid: 80175 topic_id: 13205 reply_id: 48494[/import]

So you can try to download a better editor. Xcode or TextWrangler should do the job.

Good luck! [import]uid: 54349 topic_id: 13205 reply_id: 48499[/import]

Also, try to retype the code as opposed to copy/pasting. Sometimes blogging and website platforms use “curly quotes” and things like that to increase web readability, but unfortunately messes things up when it comes to code (since things like curly quotes are different characters than regular quotes, etc).

[import]uid: 52430 topic_id: 13205 reply_id: 48503[/import]

Try this:
Make sure you are saving your file as ASCII and not UTF-* or some other encoding format. Lua might be misinterpreting the encoding format.
[import]uid: 7563 topic_id: 13205 reply_id: 48508[/import]

Im at home now and here I dont have a mac to play with =(

but tomorow ill try to solve this issue with your hints, if i dont solve it ill keep this post updated…

thank u very much!

cya =) [import]uid: 80175 topic_id: 13205 reply_id: 48512[/import]

Hey cesardesign,

If you’re looking for a REALLY basic editor for Mac (I assume you are from what you were saying) then try Eddie. It’s free and basic, nothing fancy. (It’s what I normally use.)

I look forward to hearing how you go when you’re back at a Mac :slight_smile: [import]uid: 52491 topic_id: 13205 reply_id: 48569[/import]

hi dudes, the problem was really with the default mac os text editor, it was hiding tons of chars… and there was the { at the end of the lua file… now im using this eddie that peach pellen suggested and everything is working fine.

thanks a lot for the support, ill keep my studies now :slight_smile:

cya [import]uid: 80175 topic_id: 13205 reply_id: 48589[/import]

Hurrah!

I’d been hoping to hear how it went for you today - thanks for updating us :slight_smile:

Really pleased you got it resolved, Eddie isn’t very fancy but it’s a nice little editor all things considered.

Best of luck with the studies!

Peach :smiley: [import]uid: 52491 topic_id: 13205 reply_id: 48751[/import]

The default Mac OS 'TextEdit is fine for coding lua. Just remember to go to Format -> Make Plain Text [import]uid: 50172 topic_id: 13205 reply_id: 86082[/import]