Code first - Link
my "problem" comes at line 26 and that entire function i havent written to end yet, as i got stuck
im making a program for my power monitoring (and soon to be button controlled aswell)
i would like to be able to change the amount of capacitor banks while the program is running.
but the problem is, im keeping the amount of capacitorbanks in a seperate file (only way i could get the damn thing to work, without writing the amount each time)
so i cant delete this file, while the program is running, to change the amount (was my first thought)
next thought was to delete the content and rewrite it, but that again, gets my program to error out (tried)
so could i "replace" the entire file without the program giving me an error, or is there an approach i forgot to look at
fs.open and then i need a bit of help
Started by Dustmuz, Jun 12 2015 08:50 PM
2 replies to this topic
#1
Posted 12 June 2015 - 08:50 PM
#2
Posted 12 June 2015 - 09:31 PM
You can do the exact same thing you did on line 19
When you write to the file, it will overwrite all previous data.
config = fs.open("amount","w")
amount = read()
config.writeLine(amount)
config.close()
When you write to the file, it will overwrite all previous data.
#3
Posted 12 June 2015 - 09:49 PM
i got told by Dragon 
He finaly woke up and answered on skype, at the same time you wrote this
but thanks a lot
He finaly woke up and answered on skype, at the same time you wrote this
but thanks a lot
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











