Tell me what you want, What you really, really want.

Moderator: Mmiscool

User avatar
By icnivad
#52401 Hi,
first of all i like to thank you for giving espbasic to the world, sooo much less hassle and more flexibilitythan working with an api and programming it all the time..
If ever there was a rad tool, this must be it!

since you already seem to have a file manager and complex string handling such as json, and storage is not as limited anymore..

I have a request for a couple of functions to store and read sequential data like json strings.
<string> = fileread(path)
filewrite('<path>,<string>)
e to
and to save on memory i would like to see user defined functions, with variables local to the function..

This would add a lot to the practicality..

Thanks for all the work so far..
an ESPBasic fan..
User avatar
By livetv
#54934 It seems that you are asking for just what the READ() and WRITE() functions do but with paths included and the default ".dat" extension dumped. My suggestion to any programmer who would like to implement this would be to check the first character in the file name for a forward slash ( / ). If there is one, treat the filename as a full path and don't append a ".dat" to it. Otherwise, the behavior stays as it is now. I like it!

As for user defined functions? YEAH! At first blush, that would be pretty tough the way the interpreter is set up (no offense to the programmers, who clearly did not foresee this coming way back when). I think we'd be talking about changing the way the interpreter works, allowing virtual instances of code segments. That is, the interpreter allows multiple instances of a basic programs and then functions are just another instance with a passing mechanism. That's probably a big overhaul.