Simple Keyboard Input and Output

I’m quite the n00b when it comes to Lua on the iPad. Can anyone help me with this seemingly simple problem? I want a simple program that will ask me to type my name on the keyboard and will then say “hello” to me. In pseudo code this might look like:

a = prompt("What is your name?")
print("Hello, " a, " nice to meet you.")

Thank you in advance for your help.

Please check this out.


function setup()
    print("Touch to show Keyboard\
and press return to show a message")
    a = "What is your name?"
    said = false
end

function draw()
    background(255)
    textMode(LEFT)
    text(a,100,600)
    w,h = textSize(a)
    if not said then
        n = keyboardBuffer()
    end
    if n then
        text(n,100+w+10,600)
    end
    if said then
        text("Hello "..n.." nice to meet you.",100,600- h)
    end
end

function touched(touch)
    if touch.state==ENDED then
        showKeyboard()
        said = false
    end
end

function keyboard(key)
    if key == "\
" then
        hideKeyboard()
        said =true
    end
end