Reading From Terminal

I tried the example in the Corona’s docs, but it does not work. It looks like the io.read() (line 5) is asynchronous and the suposed input used in the line 8 says the variable content is nil.

Here is the example in API

-- Prompt the user on the terminal  
io.write( "Enter you age: " )  
  
-- User enters answer on the terminal  
local answer = io.read()  
  
-- Display the answer on the terminal  
io.write( "Your age is ", answer, "\n" )  

ty in advance

Andrey [import]uid: 66709 topic_id: 29107 reply_id: 329107[/import]

I’m slightly confused by what you’re trying to achieve - how would this be applicable in an app? [import]uid: 33275 topic_id: 29107 reply_id: 117153[/import]

In fact I am not planning to use it in an app. I am preparing a material in order to teach some aspects that would use input from terminal. My intent is use the input from the terminal only in the simulator. [import]uid: 66709 topic_id: 29107 reply_id: 117177[/import]