User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
useful_programs [2020/04/17 10:56]
emozolyak [Debug printing]
useful_programs [2020/06/03 12:01] (current)
emozolyak [Other handy functions]
Line 769: Line 769:
             return false -- nothing happened ​             return false -- nothing happened ​
 end -- P_TRIG ​ end -- P_TRIG ​
 +
 +-- multiple ids or aliases read, returns table, have to be unpack() 'ed
 +-- usage: v1, v2, v3... = unpack(mRead(1,​ 2, 3, ...))
 +function mRead(...) ​
 +     local results = {} 
 +     for i = 1, #arg do 
 +         local param = arg[i]
 +        --  INFO("​processing " .. param .. " paramter"​)
 +          results[i] = GetReg(param)
 +     ​end ​
 +     if (#results == 1) then 
 +         ​return results[1]
 +     ​else ​
 +         ​return results
 +     ​end ​
 +end 
 </​code>​ </​code>​
  

Page Tools