dzVents Error Expression Expected >> Operator
Posted: Tuesday 22 March 2022 10:41
Domoticz 2022.1; Raspberry Pi 3B+, Raspberry Pi OS,
Got an error message "Expression expected near >" when declaring the >> operator:
in the code below. Also tried to use the << operator.
What is the correct way to use the << and >> operators in dzVents.
Got an error message "Expression expected near >" when declaring the >> operator:
Code: Select all
t[i+1] = (value >> (i * 16)) & 0xFFFF
What is the correct way to use the << and >> operators in dzVents.
Code: Select all
...
execute = function(domoticz, device)
domoticz.log(("%s: %s"):format(device.name, device.sValue))
local value = tonumber(device.sValue)
local t = {}
for i = 0, 3 do
'ERROR
t[i+1] = (value >> (i * 16)) & 0xFFFF
end
domoticz.log(t)
end
...