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.

For ipairs for table differences
#3
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
Reply


Messages In This Thread
RE: For ipairs for table differences - by admin - 04.12.2020, 07:18

Forum Jump: