I have the following:
[lua]
local storyboard = require “storyboard”
local widget = require “widget”
– our persistent area
storyboard.state = {}
storyboard.state.data = {}
[/lua]
But when I run I want to add tables to the storyboard.state.data table so I do this:
[lua]
storyboard.state.data = {“guitars”}
[/lua]
But that adds a string not a table. I’ve tried
[lua]
storyboard.state.data[#storyboard.state.data+1] = {“guitars”}
[/lua]
but that results in an error:
[lua]
…ds/Strings(Builds)/Strings(default)/Strings/main.lua:79: attempt to get length of field ‘data’ (a nil value)
[/lua]
So how can i add tables to tables (empty or otherwise) at runtime?
Thanks in advance!