Michel L
11-14-2011, 08:37 PM
I'm writing a spin-object that will work together with a piece of software written in Processing to monitor some values as well as set some variables.
To set variables I would like to save the address of certain variables that can be managed into an array so that the object can change them later.
Something like this:
Main program:
var
long monitorThis
obj
monitor : "Monitor"
pub start
monitor.start
monitor.registerVar(0, @monitorThis)
...
' use monitorThis
Monitor program:
var
long monitors[10]
pub start
...
pub registerVar(valIndex, reference)
monitors[valIndex] := reference
pri setValue(valIndex, value)
@monitors[valIndex] := value
...
Any ideas if this is possible and/or could work? Any suggestions for improvements?
To set variables I would like to save the address of certain variables that can be managed into an array so that the object can change them later.
Something like this:
Main program:
var
long monitorThis
obj
monitor : "Monitor"
pub start
monitor.start
monitor.registerVar(0, @monitorThis)
...
' use monitorThis
Monitor program:
var
long monitors[10]
pub start
...
pub registerVar(valIndex, reference)
monitors[valIndex] := reference
pri setValue(valIndex, value)
@monitors[valIndex] := value
...
Any ideas if this is possible and/or could work? Any suggestions for improvements?