15.01.2024, 10:23
(This post was last modified: 15.01.2024, 10:27 by pioneersteffen.)
(15.01.2024, 09:14)admin Wrote: Use this:
Code:data.hourly[i].snow['1h']
Many thanks! This idea work, but I have a problem in the case of The value doesn’t exist because there is no snow forecasted = nil.
I tried this one:
Code:
repeat
i=i+1
if data.hourly[i].snow['1h'] == nil
then
data.hourly[i].snow['1h'] = 0
end
log(data.hourly[i].snow['1h'])
snowsum = data.hourly[i].snow['1h'] + snowsum
until
i>24
but it doesn’t work.
Code:
User script:83: attempt to index field 'snow' (a nil value)
stack traceback:
Do you have an idea please?
Many thanks!