Can't even figure out "Hello World"

I’m so confused.

I used to program in C but haven’t in about 5 years. I’m obviously missing something very simple.

I created a main.lua file in plain text to print “Hello, World” to test out the simulator.

I open the simulator, hit open, navigate to my file, and…nothing. It’s grayed out. I can’t do anything.

I’ve been working on this for two hours. What am I doing wrong?

Thanks :slight_smile:
Amber [import]uid: 51881 topic_id: 8761 reply_id: 308761[/import]

what did you put in yoru main.lua?

if you want to print hello World, you will have to put it in text or it will only print in the terminal.

[lua]print(“Hello World”) – result in a print in the terminal

local testText = display.newText("", 0, 0, native.systemFont, 20)
testText:setTextColor(255, 255, 255)
testText.text = “Hello World!”
testText.x = 240
testText.y = 160

– hope this help [import]uid: 12455 topic_id: 8761 reply_id: 31923[/import]

Yes, i programmed it to print both to the terminal and the simulator. But it doesn’t matter, it won’t even open the file. It’s not like it runs a blank program; the file is grayed out completely, it won’t open at all. [import]uid: 51881 topic_id: 8761 reply_id: 31924[/import]

Can you open the main.lua files from the samples?

All I know about this is that it has to be named exactly “main.lua”. Anything else will be grayed out. [import]uid: 34108 topic_id: 8761 reply_id: 31926[/import]

What text editor are you using? Last week I was helping someone else and realized they were saving as Rich Text instead of plain text, because they were using TextEdit and that defaults to Rich Text. [import]uid: 12108 topic_id: 8761 reply_id: 31945[/import]

  1. I was using TextEdit on the Mac, saving as Plain Text with only the extension .lua.

  2. The name of the file was main.lua, saved in plain text. After typing it I copy pasted the code to make sure I wasn’t screwing up something somewhere. It simply won’t open the file. [import]uid: 51881 topic_id: 8761 reply_id: 32218[/import]

On the Mac you don’t select a file, just go inside the folder and click open. [import]uid: 5712 topic_id: 8761 reply_id: 32221[/import]

Sounds like a lot of confusion.

Try taking a step back and going through the Corona Quick Start Guide, line-by-line, even the section where it walks you through downloading TextWrangler:

http://developer.anscamobile.com/resources/corona-quick-start-guide

You’ll most-likely figure out what was going wrong in this scenario if you take the time to go through (don’t skim!) that basic tutorial.

Good luck! [import]uid: 52430 topic_id: 8761 reply_id: 32396[/import]

Did you remove the file extension name?
The open dialog needs to recognize “main.lua”.

– Advanced UI + Graph for Corona® | Website | Forum (https) | See: [import]uid: 11385 topic_id: 8761 reply_id: 31967[/import]

In the finder select main.lua
hit CMD+I to open the Information window
there’ll youll see if it’s named main.lua OR (my guess) main.lua .txt

remove .txt from the file
close the Information window
enjoy!

_Don’t_ use TextEdit, use Xcode, MacVim or TextWrangler (all three are free) [import]uid: 51782 topic_id: 8761 reply_id: 32817[/import]