Code: Select all
https://stackoverflow.com/questions/63044739/functions-that-return-multiple-values-lua
But when I try, I get an error.
this is the skeleton for the function:
Code: Select all
function ExtractElectrics(dev_switch, dev_volt, dev_watt, dev_kwh)
local switch, volt, watt, kwh = ".."
return switch, volt, watt, kwh
end
Code: Select all
a, b, c, d = ExtractElectrics(dev_name1, dev_name4, dev_name2, dev_name3)
print ("@@@@@ switch :"..a)
print ("@@@@@ volt :"..b)
print ("@@@@@ watt :"..c)
print ("@@@@@ kwh :"..d)
Does this suggest I can only return one value from a function?