User Tools

Site Tools


useful_programs

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
useful_programs [2020/04/17 10:56] – [Debug printing] emozolyakuseful_programs [2020/06/03 12:01] – [Other handy functions] emozolyak
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>
  
useful_programs.txt · Last modified: 2024/03/19 09:39 by emozolyak

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki