Jump to content
C4 Forums | Control4

How do I set (or compare) one user variable to the value of another user variable?


Recommended Posts

I playing with some programming where I track how many devices are in a certain state.  I use a variable to increment/decrement a counter when stuff changes state.  I'm finding some edge cases where the "count' can get out of sync.  So I want to periodically do a re-count.  My problem is that I have other programming that fires off when the count changes, so I don't want to use the main counter variable for this.

I want to use a temp variable (which I created like any other variable) to re-do the count, compare it to the primary variable and, if and only if, the values are different, set the primary to be equal to the temp.

But I don't see how to do this.  It only (seems to) let you set a user variable to the value of a system variable and not another user variable.

What am I doing wrong?  

I have a potential work-around for my specific use case, but I would still like to know how to do this (or confirm that, for some reason, it's not possible).

Thanks!

Link to comment
Share on other sites


9 hours ago, cnicholson said:

Got it.   I'm am idiot.  I see now that the user variables are listed alphabetically under Variables-->[User Variable Name].   I was looking for them at the bottom where agents usually show up.  I have a LOT of rooms and system variables to scroll through, but found it!

Thanks.

would be nice to be able to change views to see variables grouped ie. current selected device room1, room2, room3.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...