What is a structured table?

The documentation for C_Containter.GetContainerItemInfo() specifies that 11 values are returned. It also implies that these values are contained in a “structured table”. So, what is a structured table?

I’m asking because the following line of code doesn’t seem to work as the documentation specifies. So, I’m wondering if something has changed.

local info = { C_Container.GetContainerItemInfo( bagSlot, slotNum) }

When this is executed, info is a table type but with only one element, another table.

Anyway, I seem to be missing something, here, so any help would be appreciated.

As per the API documentation, it returns a table of type ContainerItemInfo which is:

Name = "ContainerItemInfo",
Type = "Structure",
Fields =
{
	{ Name = "iconFileID", Type = "number", Nilable = false },
	{ Name = "stackCount", Type = "number", Nilable = false },
	{ Name = "isLocked", Type = "bool", Nilable = false },
	{ Name = "quality", Type = "ItemQuality", Nilable = true },
	{ Name = "isReadable", Type = "bool", Nilable = false },
	{ Name = "hasLoot", Type = "bool", Nilable = false },
	{ Name = "hyperlink", Type = "string", Nilable = false },
	{ Name = "isFiltered", Type = "bool", Nilable = false },
	{ Name = "hasNoValue", Type = "bool", Nilable = false },
	{ Name = "itemID", Type = "number", Nilable = false },
	{ Name = "isBound", Type = "bool", Nilable = false },
},

local info = C_Container.GetContainerItemInfo( bagSlot, slotNum) 
if info then
    print(info.iconFileID, info.stackCount, info.hyperlink)
end

Thanks, so much. I like the return structure so much better.

Cheers,

its returning a table in a table because you wrapped it inside of one by using braces around it

local info = C_Container.GetContainerItemInfo( bagSlot, slotNum) should be all you need.

if youre ever not sure what somethin will output then just dump it out and see what you get, eg from the chat window type in /dump C_Container.GetContainerItemInfo(1,1) - just pick a bag/slot that has an item (unless you want to see what you get for an empty slot)