- Sat Aug 06, 2016 2:58 pm
#52332
Right now there is no file I/O in the classic sens of basic.
traditionally in basic you would "open" a file for "input" or "output" and then be able to print or input from that file line by line.
Some thing like.
open "MyFile.txt" for output as #mike
print #mike, "Some Text"
close #mike
Unfortunately in basic this is not currently possible in esp basic. I would like to add it but have not quit figured out how.
The way the current long term storage works with the read() and write() functions.
These functions allow you to store individual data elements to the flash memory. Because each one is a separate file in the system you can arbitrarily read and write data to elements. If an element dose not exist for a read it returns an empty string or value. So the elements don't necessarily need to be created first.
Remember a variable can be used for the name when calling these functions and these functions can be used in side if then statements for the logic or any other place that allows you to do instead of supplying a literal.