Slight confusion on how to set var
I am having a slight issue with setting a var in my main program from and object. I would like to change the var X from within
an object to affect the X var in the main program. I need to use another cog to change the var X, and then when the main program
uses it during its next iteration, it will see the new value that has been changed by the object. I think I need to use the @ symbol somehow,
but I don't fully understand the syntax. Do I simply write @X in the object?
Thanks, Daniel
(the issue is my lack of understanding, or ignorance. I've tried reading about it, but I just don't grasp it quite well enough.)
an object to affect the X var in the main program. I need to use another cog to change the var X, and then when the main program
uses it during its next iteration, it will see the new value that has been changed by the object. I think I need to use the @ symbol somehow,
but I don't fully understand the syntax. Do I simply write @X in the object?
Thanks, Daniel
(the issue is my lack of understanding, or ignorance. I've tried reading about it, but I just don't grasp it quite well enough.)

Comments
var long addr { place to save passed address } pub start(a,b,c,d) addr := d { save the address passed in }Wherever you want to change the variable, you'd use the following. If the variable is a byte or word, you'd use BYTE() or WORD() instead of LONG(): In the main program, you'd pass the address of the variable like this:Do I have to call the object from main, or will the value just change from within the object due to
internal processing within the object?
MAIN PROGRAM: OBJECT Xchanger:
VAR WORD Xadd PUB Start(X) Xadd := X PUB xchange WORD(Xadd) := {some new value based upon an input etc.}Does this look correct?
Daniel
Mike
WORD(Xadd) won't compile, but this will: WORD[Xadd]
I'm using BST
Daniel