-->
Page 1 of 1

Global variables please

PostPosted: Tue May 09, 2017 1:59 pm
by plomako
Hi,
ESP Basic became my favorite programing language! I just love it. But every time when working on bigger projects I hit the ceiling because of the limit in number of variables. I'm aware that introducing local/global variables would be against Basic principles ;) , but please - give me a way to do a memclear without deleting some "global variables".

Anything will be highly appreciated!

Some ideas:
global X = 66 'X will survive memclear
memclear Y 'Just Y will be removed to free one variable

Thx and good luck!
/Marcin

Re: Global variables please

PostPosted: Thu May 11, 2017 2:37 pm
by Mmiscool
Currently you could do a MEMCLEAR in conjunction with reading and writing the variables to flash.

See the following. This will store a variable to flash and return in back again after a memclear.
Code: Select allwrite("filename1",myvariable)
memclear
myvariable = read("filename1")