Sharing Data Between Multiple Programs
Is there a way for me to share data between programs?
For example, can I have the program in slot 0 ask for two integers to be entered (say X and Y), and then call another program (slot 1) to do some equation (say addition for the heck of it) place the result into another variable, and return back to program 0. Then Program 0 will display the result variable?
I would imagine this would be simple, but perhaps it is because I'm still a newbie. Any example code someone can show me would be appreciated.
Thanks
For example, can I have the program in slot 0 ask for two integers to be entered (say X and Y), and then call another program (slot 1) to do some equation (say addition for the heck of it) place the result into another variable, and return back to program 0. Then Program 0 will display the result variable?
I would imagine this would be simple, but perhaps it is because I'm still a newbie. Any example code someone can show me would be appreciated.
Thanks
![smilewinkgrin.gif](http://forums.parallax.com/images/smilies/smilewinkgrin.gif)
Comments
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
If you have a BS2p, pe or px, you can easily pass parameters via the eeprom as well, using READ, WRITE and STORE. This applicable, for example, if you want the user to enter parameters with a routine in one slot, but the parameters are actually used for actions in another slot.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
How do you tell the IDE to download the program I'm working on to go to say slot 3?
Thanks,
Stephen
Take a look at the $STAMP compiler directive. It does more than you may think it does!
Both the PBASIC Stamp Manual and the PBASIC Help File explain what you need to do.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
If I read this properly, I would simply provide the additional file name within the $STAMP directive of Program 0, for each additional program.
Such that:
' {$STAMP BS2p, NextProgram.bsp, YetAnother.bsp}
Where NextProgram.bsp is the program that will be running in slot 1, and YetAnother.bsp would run in slot 2.
Thanks,
Stephen