Bitte ändert euer Passwort!
Im März 2026 wurde das Forum gehackt. Dabei hatten die Angreifer Zugriff auf die Datenbank und somit Zugriff auf eure Passwörter. Auch wenn das Forum kein Passwort im Klartext speichert, können die Angreifer eure Passwörter knacken. Bitte ändert daher dringend euer Passwort für das Forum. Solltet ihr das gleiche Passwort auch an anderer Stelle verwenden, ändert es bitte unbedingt an allen Stellen!
So geht es:
Anleitung Passwort ändern
Limit 200 local Variables..
- Thorn
-
Autor
- Offline
- Platinum Mitglied
-
- Beiträge: 3464
- Thanks: 1485
Limit 200 local Variables..
21 Juni 2019 23:18Thorn
Sorry, wegen meiner Rechtschreibung und Grammatik!!!
Lg Thorn
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- davidmcq137
- Offline
- Senior Mitglied
-
- Beiträge: 79
- Thanks: 87
Re: Limit 200 local Variables..
09 Okt. 2021 17:13First I think all your lua apps are great!
I have run into this limit too, and have done what I am sure most lua developers do .. group variables together by common function and then make them part of a table, for example gpsSettings.zoomlevel, gpsSettings.screenSize, gpsSettings.color
instead of 3 variables this becomes one.
I have found that while this started as a workaround, it actually makes the code more readable and better self-documenting .. and with some thought on variable groupings is really much better and the 200 limit never becomes a problem again.
For me it tends to come up only at the top level of the code, where the locals are really "global" to the app .. I've never seen this limit hit in a local function inside the app.
My current strategy is to put most of the top level variables under tables like this, and only to reserve a small number of locals not under a table for things where access time/speed would be critical, since the table access will be a little slower.
The only other thought is that the local functions declared in the app are themselves local top-level variables .. so cutting down on similarly named functions e.g.
setColorMap() ... setColorTriangle() .. setColorNoFly() ... setColorRunway becomes
setColor("Map"), setColor("Triangle"), setColor("NoFly"), setColor("Runway") saves multiple top level local variables (the function names) and in my opinion is clearer to read and better structured anyway.
So maybe the genius of Roberto and the lua team is that the 200 variables limit helps us code better!
Dave
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Raf
- Offline
- Premium Mitglied
-
- Beiträge: 141
- Thanks: 192
Re: Limit 200 local Variables..
15 Okt. 2021 23:55Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Thorn
-
Autor
- Offline
- Platinum Mitglied
-
- Beiträge: 3464
- Thanks: 1485
Re: Limit 200 local Variables..
16 Okt. 2021 08:21Sorry, wegen meiner Rechtschreibung und Grammatik!!!
Lg Thorn
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- davidmcq137
- Offline
- Senior Mitglied
-
- Beiträge: 79
- Thanks: 87
Re: Limit 200 local Variables..
17 Okt. 2021 15:52And of course remember Bill Gates once said: "640K ought to be enough for anyone".
I have been totally impressed with how large apps can get and still perform well on the Jeti TX!
Bitte Anmelden oder Registrieren um der Konversation beizutreten.