Agenda de Contatos - 01

Gera um arquivo txt com os contatos.
Create a txt file with contacts.

function cadastro(name, phone, zip)
    return {name = name, phone = phone, zip = zip}

i = "y"
while i == "y" do
    print("input name")
    a =
    print("input phone")
    b =
    print("input zip")
    c =
    p = ((#list) + 1)
    list[p] = cadastro(a, b, c)
    file ="schedata.txt","a+")
    file:write(list[p].name.." "..list[p].phone.." "..list[p].zip.."\n")
    file:close ()
    print("do you want to add a contact? - (y)es (n)o")
    i =
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.