Jump to content
C4 Forums | Control4

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


cnicholson

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

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

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

Guest
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.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.