Defining tables programmatically

I have the following code that creates a table:

[lua]function get()
local definitions =
{
objects =
{
name = “Gas Can”,
image = “images/gasCan.png”,
imageSize = { width = 64, height = 63 },
canMove = false
},
{
name = “Gas Can 2”,
image = “images/gasCan.png”,
imageSize = { width = 64, height = 63 },
canMove = false
}
}
return definitions
end[/lua]

My question is how do I use that info? I’ve tried the following but get an error. In this case, objectDefinition is always nil. I have verified that definitions is a table value (non-nil) and that definitions.objects is a table value (non-nil). Is just that definitions.objects[1] is nil

[lua]local definitions = objectDefinitions.get();
local objectDefinition = definitions.objects[1]

local object = display.newImageRect(objectDefinition.image, 32, 43)[/lua] [import]uid: 19383 topic_id: 10760 reply_id: 310760[/import]

Your code is missing a pair of { }

[lua]function get()
local definitions =
{
objects =
{ ----- This one
{
name = “Gas Can”,
image = “images/gasCan.png”,
imageSize = { width = 64, height = 63 },
canMove = false
},
{
name = “Gas Can 2”,
image = “images/gasCan.png”,
imageSize = { width = 64, height = 63 },
canMove = false
}
}— and this one
}
return definitions
end[/lua] [import]uid: 48521 topic_id: 10760 reply_id: 39099[/import]

Doh! That did it. Thanks [import]uid: 19383 topic_id: 10760 reply_id: 39111[/import]