Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By Oldbod
#62233 OK now I'm really confused. Just downloaded and flashed version 66 again, the 4m version. my little test programs ( a repeating load from default.bas of menu1.bas which then loads default.bas...etc. the main header line includes vars and debug, so I'm assuming this is truely a 4m build.

It works....

And I compiled a version with the #define_tft uncommented, plus a few serial.println statements in the source, just after if param0="load", which also works, and using an #if define_tft shows is, and correctly prints both the basic program line and param1 correctly.

I don't understand why this should work now, when it wasn't before. Something subtle here....
User avatar
By Oldbod
#62255 No format. I've only formatted once or twice, my file structure stays intact between program loads so unless part of the rewriting of basic relocates the file system it's not the programs. But my basic programs for testing are minimalist. For example, the last testing I did my programs basically had a few lines each like this:

Code: Select allserialprintln "into menu1"
delay 10000
load "/default.bas"
serialprint "fell thru in menu1"

end


Interesting point - when it failed to load before, it restarted (I think) the running program containing the load staement. Now, if I try to load a non-existant statement, I get a file open failed message. (and before when the interpreter displayed the name of the file it was trying to open, it displayed it as delivered to that serial.println c statement - eg either a text string/literal, or say x$. not the value of the basic variable x$.

I wish I had more time to test properly.
User avatar
By Electroguard
#62256 That raises an important question!

Is Format generic for all build sizes? (which is how you are effectively using it).
Or is Format specific to the intended build size? (which is what I've always assumed).

Cos if you think back to formating floppies in our 'heydays' geezer - or formatting hard drives nowadays - the format doesn't just wipe the contents (or directory info), it also sets the size boundaries of the media. In which case how else could Esp_Basic know how much usable memory it had available to it unless it was using the memory size limits laid down by the appropriate size format.

So that's why I've always done an appropriate size format before flashing a different size build... which means we are both operating in subtly very different ways.