getting started with Programming in Lua and wondering about an error

Heya,

I am just trying out some of the code in programming in Lua. I know there are bound to be differences in Corona. I am trying one of the first bits of sample code,

 -- defines a factorial function function fact (n) if n == 0 then return 1 else return n \* fact(n-1) end end print("enter a number:") a = io.read("\*number") -- read a number print(fact(a))

and I am getting an error which says, “attempt to perform arithmetic on local ‘n’ (a nil value)”.

I’m on a windows 7 machine, running the code in the free edition of the Corona sdk simulator.

Any insight would be appreciated - thanks!

Nevermind! I answered my own problem. It is right in the Corona Docs under io.read,

under “Gotchyas”:

“The Corona terminal cannot be used to read user input (i.e it cannot be
used to read characters entered from the keyboard via the terminal).”

Nevermind! I answered my own problem. It is right in the Corona Docs under io.read,

under “Gotchyas”:

“The Corona terminal cannot be used to read user input (i.e it cannot be
used to read characters entered from the keyboard via the terminal).”