Slight confusion on how to set var
DRMorrison
Posts: 81
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
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:
Does this look correct?
Daniel
Mike
WORD(Xadd) won't compile, but this will: WORD[Xadd]
I'm using BST
Daniel