Global Environmental Variables nil
I have a snipit of code I got from this site has broken by pre patch. The error I get now is nil value for ActionButton_GetPagedID(button).. button being nil. Seems like the environment function is returning a table of nil. local button = _G[barName .. 'Button' .. i] button is a table but nil. Have the Global environments changed? Know a way around this??
Original code Code:
local ActionBars = {'Action','MultiBarBottomLeft','MultiBarBottomRight','MultiBarRight','MultiBarLeft'} |
The Bar/Button system has been updated now .. they are now part of the Mixin family which means some of these old functions need to be adjusted in some manner.
For example: If you had a variable 'b' to hold the actionbutton in question which you then used ActionButton_GetPagedID to customise for your addon ... you now need to customise b:GetPagedID function. This and many other files will show you other changes that have occurred recently. https://www.townlong-yak.com/framexm...tionButton.lua |
Thanks!
Code:
local button = _G[barName .. 'Button' .. j] although, could you explain why Code:
function AMine:getListFromDB(DB) |
It would depend on how DB is filled ( that part is not shown in your code )
Locate the code that fills your DB table and make sure that what it is putting in there is the same as what is being used to get access to it. |
From what I see, you're defining the function as AMine:getListFromDB() and calling as self.getListFromDB().
In this case, the first argument gets passed into the implicit variable self and DB gets the second argument, which is unspecified (automatically nil). If you called with the colon notation, self gets passed in as the implicit variable and button will get assigned to DB. For example, these function definitions are the same ... Code:
function table:func(arg) Code:
table:func(arg) |
Great catch SDPhantom. I didn't even spot that oversight. Nor the fact that DB was the variable passed in and not a DB that was filled elsewhere *sighs*
|
All times are GMT -6. The time now is 11:29 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI