BASIC Anywhere Machine (aka BAM) being a browser-based BASIC, access to hardware (like the file system or printers) doesn't come by naturally like it would for a traditional/installed BASIC implementation. I'm hoping the newly added LPRINT statement will make it easy to get output to a file. (One step towards the goal of not only making BAM better as a stand-alone BASIC implementation, but also more useful as a portable source code repository and test interpreter for bigger/standard implementations of BASIC.)
Just to get something ready right away, I've setup things so that every call to LPRINT is indeed meant to generate one file.
So aggregate all of the text you want in the variable and call LPRINT once after all of that to generate the one file.
Subsequent calls to LPRINT will create more files for what should be a different variable or same variable with a new aggregation.
Because we are doing the equivalent of a one document for one file.
Version 2 of this will involve, I think, something like functions to be called before the first LPRINT and after the last LPRINT: _startspool and _endspool.
This way, LPRINT won't try to generate a file with every call. Instead, it will just keep aggregating content for every LPRINT into a memory area, and that memory area will only kick-start the Save File As mechanism when _endspool is called.
Something like that. I want a couple of sleeps on it before I set it up.
Thanks, this makes sense. I can always concatinate the files after the basic program runs. How big can a string variable get inside my FireFox browser?
2
u/CharlieJV13 Sep 24 '22
BASIC Anywhere Machine (aka BAM) being a browser-based BASIC, access to hardware (like the file system or printers) doesn't come by naturally like it would for a traditional/installed BASIC implementation.
I'm hoping the newly added LPRINT statement will make it easy to get output to a file.
(One step towards the goal of not only making BAM better as a stand-alone BASIC implementation, but also more useful as a portable source code repository and test interpreter for bigger/standard implementations of BASIC.)
2
u/[deleted] Sep 25 '22
If one LPRINTs several times in one's program are they all collected into one output or is a dialog presented for each print statement?