01.09.2021, 12:26
(01.09.2021, 12:08)admin Wrote: It's more complicated. Value is stored raw format so it has to be decoded before comparison.thank you admin
Code:obj = grp.find('1/1/1')
rows = db:getall('SELECT * FROM objectlog WHERE address=?', obj.id)
for _, row in ipairs(rows) do
if row.datahex then
value = busdatatype.decode(row.datahex, obj.datatype)
if value <= 0 then
db:delete('objectlog', { id = row.id })
end
end
end
is it easy to make it in general (delete all obj. logs <=0)
Best Regards,