Originally Posted by Walkerbo
I can see the do but how does it work outside of a function?
|
Think of your file as one large function. The do...end block creates a new scope. That allows everything in that scope to see everything before it and globals but nothing outside of it can see or modify it's locals.
In this case the variable profitCounter, the table sellList, and the function avkSellList cannot be seen by the rest of your code and also cannot be modified if you happen to accidentally reuse one of those variable names.
Originally Posted by Walkerbo
Also the bleeding local's is due to the max limit of 200 local's used, so I am in the process of moving variables into tables to resolve this issue.
|
If you have too many locals then you are either doing something wrong or need to split your addon into multiple files.