as said in my last Post, I got 2 problems, 1 mentioned in this thread, the other here: http://www.computerc...le-doesnt-work/
This problem is already described in the title. Everytime I start my program on a turtle that booted rigth before, it errors out (KIBeta:870: attempt to call nil).
But when I end it and start the program again (without rebooting the turtle) it works perfectly fine.
menu[menustate].draw()
Line 870The variables in this line are of course completly defined as you can see here:
menustate = "Home"
menu = {
["Home"] = {
options = {"Start", "Options", "Quit"},
draw = drawMain
},
["Start"] = {
options = {"Go!", "Options", "Home", "SHelp"},
draw = drawStart
},
["Options"] = {
options = {"Start", "Home", "Help"},
draw = drawOptions
},
}
I got the theory that the turtle somehow safes the code (and the variables with it, which is bad) even when the program is closed.
What leads me to this theory is that everytime I change the code (in my external text editor) I have to reboot the turtle to make the code work. I remember that I simply had to restart the program when I programmed half a year ago.
I really hope somebody can help me with this, I'm despairing.
Full code: http://pastebin.com/fptxKN9n
Thanks in advance,
Bruno