28 posts
Location
Spain
Posted 13 August 2014 - 01:11 PM
I´m working with the fs API to do my program´s variables persistent, but I always get an error:
a = 1
fs.open("VALUES", "w")
h.writeLine(a)
fs.close()
Here I´m storing the value for A, but the turtle says: Attempt to call an Index ? (nil value)
7083 posts
Location
Tasmania (AU)
Posted 13 August 2014 - 01:21 PM
"a" isn't the problem - "h" is the value you're attempting to index into. But you haven't defined a "h"!
Try:
a = 1
h = fs.open("VALUES", "w")
h.writeLine(a)
h.close()
28 posts
Location
Spain
Posted 13 August 2014 - 02:01 PM
"a" isn't the problem - "h" is the value you're attempting to index into. But you haven't defined a "h"!
Try:
a = 1
h = fs.open("VALUES", "w")
h.writeLine(a)
h.close()
Thanks, now I can continue doing my script
1080 posts
Location
In the Matrix
Posted 14 August 2014 - 05:44 PM
I work with the fs API alot in what i usually work on, (just door locks :P/>) and a tutorial i read that helped me alot with learning it is
Here.