Is it possible to return all of the return values from a
"different" function that has multiple returns in a single return statement?
Like:
Lua Code:
local function somefunc(_iBagId, _iSlotId,)
-- This might seem pointless, but I wanted an example people would be familiar with --
return GetItemInfo(_iBagId, _iSlotId)
end
and then call that function and capture everything like:
Lua Code:
local sIcon, iStack, iSellPrice, bMeetsUsageRequirement, bLocked, iEquipType, iItemStyle, iItemQuality = somefunc(bagId, slotId)
or do you have to capture all of the returns and then return them like:
Lua Code:
local function somefunc(_iBagId, _iSlotId,)
local sIcon, iStack, iSellPrice, bMeetsUsageRequirement, bLocked, iEquipType, iItemStyle, iItemQuality = GetItemInfo(_iBagId, _iSlotId)
return sIcon, iStack, iSellPrice, bMeetsUsageRequirement, bLocked, iEquipType, iItemStyle, iItemQuality
end
I tried googling for the answer, but no luck.