This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Search all Objects
#1
Looking for help on how to count how many objects with a tag name of ALARM (250. byte string) which has current values like ARMED and another count for those that have DISARMED.
These can then be added to OBJECTs to include in a DASHBOARD
Reply
#2
Something like this
Code:
text='ARMED'
myobjects = grp.tag('ALARM')
sum = 0
  for _, obj in ipairs(myobjects) do
    if obj.value == text then
        sum = sum+1
    end
  end
log(sum)
------------------------------
Ctrl+F5
Reply
#3
Many thanks Daniel
Reply


Forum Jump: