Posted 31 August 2015 - 10:06 PM
Hello guys. I Have one file called
inside i have:
In another program i have:
Before when i only have the First table:
How can i read the first table separate of the second?
And how can i modify using the another program to modify this values in the file called "lista" ?
"lista"
inside i have:
{
Nome = "Thales",
Cidade = "MG",
Idade = "22",
}
{
Nome = "Tio Cocota",
Cidade = "MG",
Idade = "55",
}
In another program i have:
local file = fs.open("lista","r")
local data = file.readAll()
file.close()
local a = textutils.unserialize(data)
print("Nome: "..a.Nome)
print("Idade: "..a.Idade)
print("Cidade: "..a.Cidade)
Before when i only have the First table:
{
Nome = "Thales",
Cidade = "MG",
Idade = "22",
}
it worked, but now i have "2 tables" inside the first File, the code gives an error, because i have 2 "Nome", first called "Thales" and the second "Tio cocota"How can i read the first table separate of the second?
And how can i modify using the another program to modify this values in the file called "lista" ?
Edited on 31 August 2015 - 08:08 PM