I think it's because it's index via a byte in the bytecode - so no, there is no way around this apart from putting your lesser used variables in a table or not making them local.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
btw I'm not sure if multiple lua files will fix it.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
After a little experimentation I have discovered that local functions also count as a local variable as far as LUA is concerned, so having 199 local variables and 1 local function will effectively put you at the 200 local variable limit.
Any function inside a LUA file can have 200 local variables too.
@pie - well I just made a LUA file and manually created created 199 local variables. Adding one more local variable (or function) causes the limit to be reached.
I don't think there is any way to actually know when you will hit the limit until you do.
I had this problem too (with Corona as well). The only thing you can do is make some variables global which kind of goes against what we are told about the importance of local variables. Personally I think there is no harm in having local variables in outer scope. I would use local only for variables within functions.
No Longford was a program I wrote when Gideros was still closed source (and restricted to Android and iOS targets). The idea was to allow existing Gideros programs to run on new hardware (Longford supports BlackBerry PlayBook, Windows desktop, Windows Store "Metro" and Windows Phone). I initially wrote it because I wanted to port my game to PlayBook but then it grew into something bigger.
But then Gideros was open sourced and ported to many new targets so Longford is no longer needed really. A lot of Gideros features are absent from Longford as well, so not much point using it these days. The only good thing about it is that the source code is much shorter and simpler than Gideros. And it does support BlackBerry which Gideros still lacks. So perhaps we could add that target to Gideros if there is any interest (and money!)
Writing Longford gave me lots of the tools needed to prepare the WinRT port of Gideros (knowledge of DirectX and WinRT in particular -- and familiarity with Visual Studio)
Comments
https://deluxepixel.com
https://deluxepixel.com
Any function inside a LUA file can have 200 local variables too.
How do you count them?
Thank you
Likes: antix
I don't think there is any way to actually know when you will hit the limit until you do.
Likes: pie
Likes: antix
https://github.com/gideros/gideros
https://www.youtube.com/c/JohnBlackburn1975
Hey is Longford the precursor to Gideros?
But then Gideros was open sourced and ported to many new targets so Longford is no longer needed really. A lot of Gideros features are absent from Longford as well, so not much point using it these days. The only good thing about it is that the source code is much shorter and simpler than Gideros. And it does support BlackBerry which Gideros still lacks. So perhaps we could add that target to Gideros if there is any interest (and money!)
Writing Longford gave me lots of the tools needed to prepare the WinRT port of Gideros (knowledge of DirectX and WinRT in particular -- and familiarity with Visual Studio)
Likes: antix
https://github.com/gideros/gideros
https://www.youtube.com/c/JohnBlackburn1975