16 posts
Location
U.S
Posted 02 September 2013 - 03:03 PM
i made a program called safe delete but it dose not work and i cant seem to find the problem
me = yes you = no
term.setCursorPos(1,1)
term.clear()
print("Are You Sure")
print("yes or no?")
input = read()
if input == "me" then
local tArgs = { ... }
if #tArgs < 1 then
print( "usage: rm <path>" )
return
end
end
local sNewPath = shell.redolve( tArgs[1] )
print("file deleted")
sleep(1)
term.clear()
if input == "you" then
print("Delete Canceld")
sleep(1)
term.clear()
end
and ik i fail at spelling
and the error code is :16: attempt to index ? (a nil value)
7508 posts
Location
Australia
Posted 02 September 2013 - 03:13 PM
it's not shell.redolve, try `shell.resolve` instead.
your print after that line wont work, you're not starting or finishing the string, and you're also not finishing the function call. surround `file deleted` with quotes and add a ) to the end.
16 posts
Location
U.S
Posted 02 September 2013 - 05:23 PM
it's not shell.redolve, try `shell.resolve` instead.
your print after that line wont work, you're not starting or finishing the string, and you're also not finishing the function call. surround `file deleted` with quotes and add a ) to the end.
thanks
16 posts
Location
U.S
Posted 02 September 2013 - 05:26 PM
it's not shell.redolve, try `shell.resolve` instead.
your print after that line wont work, you're not starting or finishing the string, and you're also not finishing the function call. surround `file deleted` with quotes and add a ) to the end.
thanks
wait that was a typo it is like that in the real program
1583 posts
Location
Germany
Posted 02 September 2013 - 05:33 PM
The top of the program won't work.
You try to give "me" the value of the variable "yes" but "yes" is nil. The same for "you"
16 posts
Location
U.S
Posted 02 September 2013 - 05:44 PM
The top of the program won't work.
You try to give "me" the value of the variable "yes" but "yes" is nil. The same for "you"
ok what do i need to do to fix that
1583 posts
Location
Germany
Posted 02 September 2013 - 06:33 PM
me = "yes"
you = "no"
When you remove the "s at your if statements it should work fine
7508 posts
Location
Australia
Posted 02 September 2013 - 06:36 PM
Still won't work as intended though. Take a look at your if statements for checking the input. Id provide more info, but I'm on my phone.
16 posts
Location
U.S
Posted 02 September 2013 - 07:03 PM
me = "yes"
you = "no"
When you remove the "s at your if statements it should work fine
that still did not work
1583 posts
Location
Germany
Posted 02 September 2013 - 07:12 PM
me = "yes"
you = "no"
When you remove the "s at your if statements it should work fine
that still did not work
what is the error you get?
16 posts
Location
U.S
Posted 02 September 2013 - 07:36 PM
me = "yes"
you = "no"
When you remove the "s at your if statements it should work fine
that still did not work
what is the error you get?
same error
7508 posts
Location
Australia
Posted 02 September 2013 - 07:48 PM
same error
can you please put your code onto pastebin so that we can see the exact code you have and not a retype into this thread.
16 posts
Location
U.S
Posted 02 September 2013 - 07:56 PM
same error
can you please put your code onto pastebin so that we can see the exact code you have and not a retype into this thread.
its on a server so i cant do that
7508 posts
Location
Australia
Posted 02 September 2013 - 08:23 PM
its on a server so i cant do that
well look at line 16 (there is a counter on the bottom right) and please make sure you type it character for character here.
1583 posts
Location
Germany
Posted 03 September 2013 - 08:52 AM
me = "yes"
you = "no"
When you remove the "s at your if statements it should work fine
that still did not work
what is the error you get?
same error
look at this:
it's not shell.redolve, try `shell.resolve` instead.
your print after that line wont work, you're not starting or finishing the string, and you're also not finishing the function call. surround `file deleted` with quotes and add a ) to the end.