Child and Parent objects using shared drivers - how to get the vars to work cor
Kye
Posts: 2,200
So, I have a parent object that has all my driver objects attached to it through the OBJ statement.
I want to attach a child object to that parent object that uses the same set of drivers. To do that however I need to import the drivers in that childs OBJ section.
However I really don't need sepearte var sections for each object version... Because this prevent the child from actually having working code.
So, how can I get arround this?
I remember looking arround and seeing that if I made the var section in my drivers into a Dat section that the vars would not be replicated again. But I would rather not change my code now.
Is it possible to have the child object import the parent object to gain acess to the drivers which the parent is importing? I could then just have the child call the parent object since the child would be the top object I belive.
Or is there another way to get arround this? Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
I want to attach a child object to that parent object that uses the same set of drivers. To do that however I need to import the drivers in that childs OBJ section.
However I really don't need sepearte var sections for each object version... Because this prevent the child from actually having working code.
So, how can I get arround this?
I remember looking arround and seeing that if I made the var section in my drivers into a Dat section that the vars would not be replicated again. But I would rather not change my code now.
Is it possible to have the child object import the parent object to gain acess to the drivers which the parent is importing? I could then just have the child call the parent object since the child would be the top object I belive.
Or is there another way to get arround this? Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Comments
The only way around this is to have drivers with no VAR storage and to include these in every object that needs to reference them. Any variables would either be in a DAT area or could be allocated "dynamically" in some otherwise unused area of RAM (like the high end of RAM where some video buffers are sometimes allocated. Only one copy of the code would be stored in hub RAM.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,