Referencing CON and DAT information from other Objects
Dave Hein
Posts: 6,347
I would like to be able to reference constants and data tables that are defined in one object from another one.· As a simple example, I would want to define NULL in one object, and use it in another.· A more complex example would be to define the fixed offsets of varaibles within a data structure and allow another object to access these constants.· Is there anyway to do that in Spin?
At one point I had throught that variables defined in DAT sections could be shared by other objects.· However, there this doesn't seem to work.· Is there anyway to do this?
The only way I can see to resolve either of these issues is to provide methods that return the value of a constant and pointers to areas of memory in the DAT section.
At one point I had throught that variables defined in DAT sections could be shared by other objects.· However, there this doesn't seem to work.· Is there anyway to do this?
The only way I can see to resolve either of these issues is to provide methods that return the value of a constant and pointers to areas of memory in the DAT section.
Comments
No other elements except the pub-functions are visible from outside of an object, so ... yes ... you have to define functions to retrieve the addresses of DAT or VAR variables.
Thanks, that's very helpful.
Dave