Global Variable
crgwbr
Posts: 614
In one program I am writing, I have a variable declared and constintly·altered one object. I need to access this variable in another object (running in another cog).· How can I constintly access that variable from the second cog?· Do I have to declare the variable somehow in the second object?
Thanks,
crgwbr
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
Thanks,
crgwbr
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Thanks,
crgwbr
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
The expression long[noparse][[/noparse]a] "fetches" the first long from this address (similarly for byte and word).
So long[noparse][[/noparse]@a] (for a long variable a) is essentially the same as just a.
Regards,
Eric
http://forums.parallax.com/forums/default.aspx?f=25&m=157798
crgwbr
PS: SailerMan, I live in PA.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
long[noparse][[/noparse]address]
word[noparse][[/noparse]address]
byte[noparse][[/noparse]address]
depending on what the size is.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who says you have to have knowledge to use it?
I've killed a fly with my bare mind.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life