Posted 08 December 2012 - 07:29 AM
ok so i have this code:
as im sure you can work out, you enter a name then it goes and checks to see if it exists in the entrys folder. if it does it prints:
entry already exists
if it does not exist it prints:
Entry Ok.
but i get an error on the IF statment line saying
"attempt to call string".
i think there is a problem with the exist varible but cant work out what it is?
can anyone help me out a little?
thanks -Cheeky
local path = "entrys"
term.clear()
term.setCursorPos(1,1)
print("Please enter an entry name...")
write("Name: ")
local name = io.read()
local exist = fs.exists(path "/", name)
if exist then
print("Entry Already Exists.")
else
print("Entry Ok")
as im sure you can work out, you enter a name then it goes and checks to see if it exists in the entrys folder. if it does it prints:
entry already exists
if it does not exist it prints:
Entry Ok.
but i get an error on the IF statment line saying
"attempt to call string".
i think there is a problem with the exist varible but cant work out what it is?
can anyone help me out a little?
thanks -Cheeky