Copying code from web pages and pasting into a text editor does not work

Noob question: When I copy code examples from web pages and pasting into a text editor the code does not work. For example if I copy and paste: local bg = display.newImage( “background.jpg” ) local would be in blue and “background.jpg” would be in red. Not surprisingly, the line of code does not work unless I retype those two examples. I’m using Textmate and TextWrangler with the same results. [import]uid: 39859 topic_id: 34261 reply_id: 334261[/import]

Make sure the quote marks are not “smart quotes.” Try retyping just the quote marks and see if that helps.

Jay
[import]uid: 9440 topic_id: 34261 reply_id: 136234[/import]

Cutting and pasting should work most of the time. However some websites will tend to use fancy quotes and not the ASCII " marks and that can mess up things. HTML sometimes will inject HTML code instead of the actual symbols. And stuff cut/pasted from Microsoft Office documents are very likely to not work.

But unless I know where you’re copying from, its going to be hard to diagnose what the cause is. Also are you seeing any errors when you try to run it?
[import]uid: 199310 topic_id: 34261 reply_id: 136240[/import]

Every websites have different setting , so it could be a website problem.
software patents [import]uid: 207348 topic_id: 34261 reply_id: 136251[/import]

Thanks guys! The problem was the smart quote thing. I didn’t even know what one was until now. [import]uid: 39859 topic_id: 34261 reply_id: 136255[/import]

Make sure the quote marks are not “smart quotes.” Try retyping just the quote marks and see if that helps.

Jay
[import]uid: 9440 topic_id: 34261 reply_id: 136234[/import]

Cutting and pasting should work most of the time. However some websites will tend to use fancy quotes and not the ASCII " marks and that can mess up things. HTML sometimes will inject HTML code instead of the actual symbols. And stuff cut/pasted from Microsoft Office documents are very likely to not work.

But unless I know where you’re copying from, its going to be hard to diagnose what the cause is. Also are you seeing any errors when you try to run it?
[import]uid: 199310 topic_id: 34261 reply_id: 136240[/import]

Every websites have different setting , so it could be a website problem.
software patents [import]uid: 207348 topic_id: 34261 reply_id: 136251[/import]

Thanks guys! The problem was the smart quote thing. I didn’t even know what one was until now. [import]uid: 39859 topic_id: 34261 reply_id: 136255[/import]