Passing a variable's address from one object to another
MacGeek117
Posts: 747
I need to pass two values from one object·to a higher object. Can I pass the addresses of the variables when I start the object:
and at a later point use BYTEFILL to pass the values?
RoboGeek
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"I reject your reality and subsitute my own!"
Adam Savage, Mythbusters
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.jameco.com
·
MyObj.start(@var1, @var2) 'in MyObj: start(_addr1, _addr2) addr1 := _addr1 addr2 := _addr2
and at a later point use BYTEFILL to pass the values?
bytefill(addr1, somevalue, 1) bytefill(addr2, somevalue + 26, 1)
RoboGeek
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"I reject your reality and subsitute my own!"
Adam Savage, Mythbusters
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.jameco.com
·
Comments
What you've outlined should work fine.
RoboGeek
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"I reject your reality and subsitute my own!"
Adam Savage, Mythbusters
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.jameco.com
·
First I assume you mean you start a different process in a COG, which will run in a loop, and you to update it, or get results in return.
Have a look at this example
RoboGeek
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"I reject your reality and subsitute my own!"
Adam Savage, Mythbusters
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.jameco.com
·
Writing to those parameters is generally done - as I showed you - by dereferencing it with SIZETYPE[noparse][[/noparse]address]; less often using BYTEFILL....
I was also a little bit confused why you du this:
??
The output side has code I will be copywriting, so I don't want to post code quite yet.
RoboGeek
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"I reject your reality and subsitute my own!"
Adam Savage, Mythbusters
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.jameco.com
·