Multiple Files in BS2
kingbp
Posts: 22
Hi I'm working on a project with two files or programs and I need to run both projects at once but I just found out that the BASIC Stamp 2e, 2sx, 2p, 2pe, and 2px modules support multi-file projects you can save multiple files like such: ' { $STAMP BS2e, file2, file3, ..., file8 } but this isn't possible on the BS2 is there any alternate way I can save multiple files on the Bs2.
Comments
You'll have to combine the two source files using cut and paste in the editor. Obviously, you'll have to modify the programs so they can coexist and there'll have to be enough room for both in the 2K.
Remember that the multiple files act somewhat like overlays. Only one can run at a time and, when a slot is started, it always starts from the beginning. Variables can be shared and that's often how a slot's program can have several entry points ... a variable gets set with a code indicating what part of the slot's program is to get control and there are some IF / THEN statements at the beginning to jump to the part of the slot's code corresponding to the variable's value. Other variables may be used to pass parameters. There's no direct way to return control back to the "main slot". You can only start the main program over from the beginning, but variables are shared.