Logic Machine Forum
How to refer directly to the cell of the table with a name "1"? - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: How to refer directly to the cell of the table with a name "1"? (/showthread.php?tid=95)



How to refer directly to the cell of the table with a name "1"? - buuuudzik - 05.10.2015

Do you know how to refer to the table which has a name "1" in this case?
Code:
log(data.1.period)
I solve this problem in this way:
Code:
data1 = data[1]
log(data1.period)

but do you know how to do this without any additional code?


RE: How to make a connection and download weather data from wunderground - admin - 05.10.2015

You must use square brackets when accessing numeric indexes, try this:
Code:
log(data.forecast.simpleforecast.forecastday[1].period)



RE: How to make a connection and download weather data from wunderground - buuuudzik - 05.10.2015

(05.10.2015, 11:28)admin Wrote: You must use square brackets when accessing numeric indexes, try this:
Code:
log(data.forecast.simpleforecast.forecastday[1].period)

ThanksWink