syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me

Question:
In Lua how to read keyboard input?

Let the Lua syntax do the talking:
print("Enter a number but not a string:")
mynum = io.read("*number")
print(mynum)
print("Enter anything, then press enter, and then control-d:")
mystr = io.read("*a")
print(mystr)
print("Enter anything:")
mystr = io.read()
print(mystr)

syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me