10 posts
Posted 27 June 2013 - 05:13 PM
When I want to edit my to do list I need to edit the program and then reboot, I made the to do list I an just looking for a separate program that will ask questions like what line and then you can edit the line then when you are done it will automatically reboot.
8543 posts
Posted 27 June 2013 - 09:52 PM
Split into new topic.
Please post your existing code and any error messages you receive while running it.
1114 posts
Location
UK
Posted 28 June 2013 - 02:59 AM
I was bored, and feeling kind. If you wanted to save the to-do list in a file try something like this:
if not fs.exists("todo") then
handle = fs.open("todo", "w")
handle.writeLine("{}")
handle.close()
end
handle = fs.open("todo", "r")
todo = textutils.unserialize(handle.readLine())
handle.close()
term.clear()
term.setCursorPos(1,1)
print("To-do list")
print("Please enter the item number in the to-do list")
n = tonumber(read())
if type(n) == "nil" then term.clear() term.setCursorPos(1,1) error("That was not a number", 0) end
term.clear()
term.setCursorPos(1,1)
if not todo[n] then
print("Current value: nil" )
print("Please enter the new value")
new = read()
todo[n] = new
else
print("Current value: " .. todo[n] )
print("Please enter the new value")
new = read()
todo[n] = new
end
handle = fs.open("todo", "w")
handle.writeLine(textutils.serialize(todo))
handle.close()
You might get bad responses if you ask for people to make you programs in this forum. :)/>
10 posts
Posted 28 June 2013 - 08:42 AM
Thanks, ZodoHackz I will try that, is that everything or just the editor?
10 posts
Posted 28 June 2013 - 08:44 AM
No error messages, paste bin code will be posted shortly
Code is: KeQMhB6M
10 posts
Posted 28 June 2013 - 09:15 AM
ZodoHackz i get an error message, attempt to concatenate string and nil
1114 posts
Location
UK
Posted 28 June 2013 - 12:12 PM
ZodoHackz i get an error message attempt to concatenate string and nil
I know, I will edit it!
EDIT: done!
10 posts
Posted 28 June 2013 - 05:39 PM
You edited the code a couple posts above? And what do I name the programs(s)?
41 posts
Posted 28 June 2013 - 05:48 PM
How about 'ToDo'?
10 posts
Posted 28 June 2013 - 09:41 PM
Sorry but is that the displayer to the monitor and the editor. Or is it just the editor????
Thanks for your time
355 posts
Posted 29 June 2013 - 12:51 AM
You might want to have a look at my Todo program then, it has a simple editor that could get you started.
pastebin.com/vFaHf7K
10 posts
Posted 29 June 2013 - 09:57 AM
Thanks I will check it out!
Did you enter the code wrong???
10 posts
Posted 29 June 2013 - 11:29 AM
i read up on lua and made one!!!