Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By Electroguard
#65390 I don't know the ins and outs, only what I've experienced for myself, and how I've learned to cope best with the situation.
The 'quantum weirdness' I experience is a bug, and something to do with the web stuff.
It is not device specific, because I experience the same symptoms on a variety of different devices with differing amounts of memory.
It appears to be a bug concerning memory management - it becomes apparent as memory gets used up even though there is still usable memory available. It's as if the interpreter uses part of memory as a temporary buffer space for web based components but is not carefully managing what memory it is using, resulting in things being overwritten and therefore corrupted.

If the script does not utilise any of the 4Mb graphics etc 'extra's it may be possible to improve the situation by formatting and flashing 4Mb devices to be 1Mb, which seems to leave more 'slack' memory available for interpreter use, but the same quantum weirdess symptoms will eventually appear when available memory starts running out again.

The whole quantum weirdness situation eats up loads of time waiting for reconnections after rebooted saves etc, so painful experience has taught me not to waste more time trying to cut little corners - therefore I ALWAYS do a REFORMAT first, wait 15 seconds (or until I've seen the esp blue led blink after the format... it must be doing something!) then do the REFLASH in the cleanest circumstances.

Splitting a large web page into several smaller web pages helps the situation, suggesting that it's a problem with holding all the buffered web page components prior to sending them to the browser.
My impression is that the buffered screen contents get sent at each WAIT command, which should allow the buffer to be emptied with each WAIT - but maybe the buffer boundaries are being mis-managed, or over-lapping with other data areas that are being rewritten with other data, effectively corrupting the buffer... but this is only conjecture.

So if the bug is due to a web content buffer problem, best to keep the web buffer as little-used as possible, and the simple way of doing that is to split any large web pages into multiple smaller pages.

You don't need to complicate matters with juggling LOAD commands, simply branch to different subroutines within the same script as demonstrated below... but please note it is off the top of my head and makes no pretence to being a practical working script.

'Common script
[HOME]
CLS
HTML "Home page" & "<BR>"
BUTTON "Page2", [PAGE2]
BUTTON "Config", [CONFIG]
BUTTON "Help", [HELP]
BUTTON "Exit", [EXIT]
WAIT

[PAGE2]
CLS
HTML "Page2" & "<BR>"
BUTTON "Home", [HOME]
BUTTON "Config", [CONFIG]
BUTTON "Help", [HELP]
BUTTON "Exit", [EXIT]
WAIT

[CONFIG]
CLS
HTML "Configuration" & "<BR>"
BUTTON "Home", [HOME]
BUTTON "Page2", [PAGE2]
BUTTON "Help", [HELP]
BUTTON "Exit", [EXIT]
WAIT

[HELP]
CLS
HTML "Help" & "<BR>"
BUTTON "Home", [HOME]
BUTTON "Page2", [PAGE2]
BUTTON "Config", [CONFIG]
BUTTON "Exit", [EXIT]
WAIT

[EXIT]
END
User avatar
By Pierre
#65392 Thanks for the reply. I already tried to break the program into as many branches as possible without luck. I cannot get the LOAD function or command to work. It is not well documented as the documentation does not describe how it will execute. For example will it completely close the current .bas program and start executing the new loaded one from start and if you would like to return to the same place where you exited the first one. I broke my unstable program into two programs and both seems to work correctly without crashing. When I create a button to execute the "SETUP" program that I wrote, it does not exit the current program, but prints at the bottom of the page :
_________________________________

Loading....\setup.bas
__________________________________

Done...

So, it seems that it loads the file and then confirms it, but does not close the current and display the loaded file. Some advice will be appreciated if you have done this before

Regards
Pierre
User avatar
By Mmiscool
#65394 The load command is broken at the moment. It is related to the same issue that causes a reboot if the save command is excited after running a program.


You can make you interface talk with the interpreter using JavaScript on the browser side using JavaScript that way the HTML buffer only contains the minimum information for the interface and a JavaScript file can run in the browser to do any fancy coloring of things based on values.
User avatar
By Pierre
#65401 Hi
Thanks for the info. Is it on a schedule to try and fix the issues or will it be a long term project. I would just like to know if it is worthwhile to stick with the language or change to a new platform. My problem is that I have been out of programming for a long time and Basic still make sense to me from the 80s. I don't know Java at all and programmed a little in C many years ago. This will mean a total new learning curve if I need to switch to something different. Thanks for all the good work done so far with the system.

Regards
Pierre