34 posts
Posted 05 January 2013 - 09:43 AM
i just want to make a simple program i dont no how to do it i just want to make it so every time it runs the code it makes the veriable times open +1 so the veriable will be the times that line of code was run but i dont no how to do it
1111 posts
Location
Portland OR
Posted 05 January 2013 - 10:05 AM
To increment a value simply add +1 to it.
timesOpened = timesOpened + 1
If you want it to be persistant you will want to save it to a file, you can use either fs or the io API to take care of that. There is tutorials here on the forum on how to use those so there is no sense in me explaining it here. If you run into any problems let us know.