Sharing Objects
Claytron
Posts: 6
I'm working in the planning stage for an application I'm about to write for the Propeller. This will be my first major Propeller project. I intend to two have two cogs running at all times. Upon execution, the main controller object spawns another one that's an input monitor object. They both need to access methods in a separate functionality controller. It's most important to the input monitor, so I was originally planning to have it as a child of that object, but the main cog needs it as well... what is the tidiest way to have the functionality object's methods available to both objects? Thanks for your thoughts.
Comments
if there is, you need to have some way to keep order and only one cog at a time accessing it
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Parallax Forums - If you're ready to learn, we're ready to help.
... and so on.
The second technique requires that any global variables in the functionality controller are in a DAT section and there's no VAR section. You declare this child object in both the main program and the input monitor. The code and DAT section(s) are the same for both instances.
Post Edited (Claytron) : 4/21/2007 4:48:18 AM GMT