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

Moderator: Mmiscool

User avatar
By Electroguard
#63465 It would have been a great facility if Esp_Basic could have loaded and run (chained) an external program - eg: load and run a subroutine, and then 'return' control back to the 'calling' program. But there's not enough memory to hold 2 programs at the same time, and not adequate resources for paging program modules in and out of memory.
So the 'load' instruction seems designed to just load and run a different program in place of the original 'calling' program.

But it does so while still retaining the original VARs, all of which become available to the newly 'loaded' program.
So in theory...
The main program could run 'first time around' and set appropriate flags, then 'load' a secondary program module which might behave according to the flags and VARs inherited from the first program.

The secondary might do its thing and change vars and flags etc, then eventually re-'load' the main program again, which might now behave totally differently depending on inherited flags and VAR changes.

It did seem to work mostly when I tried it a while ago, but it seemed to get some branch names and their corresponding 'jumps' muddled up, which was when I needed to ask mmiscool to detail what VARs limitations existed... and subsequently found that most of my VAR limitations were being exceeded, so I moved on to other things.
User avatar
By Oldbod
#63782 Not had time to work on load issue(not that i would have found solution anyway!) But if you want to reload a previous program simply call a command stub program after setting a variable that determines what the command stub does. Or do you want to use loaded program as a called subroutine?