04.12.2020, 07:18
Use this code if each table member is a group address or an object name. Make sure that each table has the same number of elements.
Code:
temp = { 'Temp 1', 'Temp 2', 'Temp 3' }
diff = { 'Diff 1', 'Diff 2', 'Diff 3' }
result = { 'Result 1', 'Result 2', 'Result 3' }
for i, res in ipairs(result) do
val = grp.getvalue(temp[ i ]) - grp.getvalue(diff[ i ])
grp.write(res, val)
end