When chain-loading XB programs, my usual process has been to save the variables to disk before loading the next program then retrieving them back. I was thinking, since low memory is preserved in XB during that process, why not use CALL LOAD to save the variables to low memory and retrieve them subsequently with a CALL PEEK? This would speed up the process tremendously. Am I missing something here?
I do quite a bit of this in Heatwave's programs, both to save simple variables and to leverage a single loader to launch all programs. I use memory starting at >A000 since none of my programs+numerics are exactly 24k For example, I use one loader program that contains all of the "RUN" statements. To chain to another program, I CALL LOAD with the number representing the program I want to load; launch the loader, CALL PEEK the value, and do an ON GOTO to the right RUN statement. Saves me (and others) from modifying paths all over the place in every program.
There are also ways to RUN programs via a string or via assembly (thanks SeniorFalcon) which I employ to launch the loader. I save the path into low memory using a STRREF link so that the assembly run routine knows where my loader is located. Stops me from having to edit that one, last path per program I have also used a configuration file and a RUN String routine for some programs but had to be careful due to error trapping and it adds another level.
I guess the nice thing is you can be creative in your uses of memory, from the simple to complex.
(I just use standard XB cartridge and no compiling)
Edit: lol, I saw TheBF's link just now as well. Forgot about that thread myself.