Moin....
was ist der Unterschied von den folgenden Codezeilen, wenn ich diese nicht in einer Funktion eingebe, sondern z.B. ganz oben als erstes im Lua Code ?
1. roll_rel_19_1_flag = use 'LCN.relay.0.19.1'
2. down = {'11------';'--11----';'----11--';'------11'}
3. set ('VAR.KOBELKA.event.lichtaussen',"0")
Es werden doch bei allen drei Zeilen Variablen erstellt die ich irgendwo im weitern Lua-Code weiterverarbeiten kann, z.B. auch in anderen Funktionen....
Wo ist hier nun der genaue Unterschied ? (es geht hier jetzt nicht darum das die oben genannten Variablen einen anderen Inhalt haben ;-) )
Gruß
Jörg
Willkommen auf unserer neuen Forenplattform für das Bus-Profi Forum
Neue Felder für die persönlichen Daten
Man kann jetzt seine öffentlich einsehbare Daten genau bestimmen. Details findet ihr in in diesem Beitrag.
Durch die neue Forensoftware und die Portierung der Daten konnten die Passwörter aus dem alten Forum nicht übernommen werden, bitte lassen Sie sich ein neues Passwort über die Passwort vergessen Funktion zusenden. Sollte es zu Problemen kommen kontaktieren Sie das Bus-Profi Team per E-Mail.
Neue Felder für die persönlichen Daten
Man kann jetzt seine öffentlich einsehbare Daten genau bestimmen. Details findet ihr in in diesem Beitrag.
Durch die neue Forensoftware und die Portierung der Daten konnten die Passwörter aus dem alten Forum nicht übernommen werden, bitte lassen Sie sich ein neues Passwort über die Passwort vergessen Funktion zusenden. Sollte es zu Problemen kommen kontaktieren Sie das Bus-Profi Team per E-Mail.
Unterschiedliche Variablen ?
-
DOMIQ-Support
- Fleißiges Mitglied

- Beiträge: 292
- Registriert: Fr 7. Jun 2013, 09:59
- Status: Offline
#2 RE: Unterschiedliche Variablen ?
In the first line you declare a variable that will refer to an object. In the second line you declare a table (which is an ordinary object in lua). And in the third line you invoke the set function that will set value of a given identifier.
-
koboldo
Themenersteller - Fleißiges Mitglied

- Beiträge: 324
- Registriert: Do 16. Feb 2012, 15:50
- Status: Offline
#3 RE: Unterschiedliche Variablen ?
Und 1. und 2. tauchen nicht unter Zustand auf, aber können genauso im Code genutzt werden und brauchen nicht mit get in Funktion geholt werden...oder ?
-
DOMIQ-Support
- Fleißiges Mitglied

- Beiträge: 292
- Registriert: Fr 7. Jun 2013, 09:59
- Status: Offline
#4 RE: Unterschiedliche Variablen ?
The first 2 won't be visible in the State tab, but you can refer to those variables in the Logic tab. You can get value of the variable declared in the first line by typing something like this: newValue = variable.value, for example relValue = roll_rel_19_1_flag.value. You can use it inside function or so.
The second variable is just a lua table and should be handled as a lua table:) So for example down[1] will get first element and so on (remember that tables indexes in lua starts at 1 not at 0 like in the most programming languages):)
The second variable is just a lua table and should be handled as a lua table:) So for example down[1] will get first element and so on (remember that tables indexes in lua starts at 1 not at 0 like in the most programming languages):)
-
Beleuchtfix
- Administrator

- Beiträge: 5304
- Registriert: Mi 10. Jan 2007, 18:49
- Kontaktdaten:
- Status: Offline
#5 RE: Unterschiedliche Variablen ?
One more:
set and get take a while! If you use within the lua code set and try to use it later down in the code again, most likely the variable is not updated yet.
Gruß
Florian
set and get take a while! If you use within the lua code set and try to use it later down in the code again, most likely the variable is not updated yet.
Gruß
Florian
-
DOMIQ
- Fleißiges Mitglied

- Beiträge: 252
- Registriert: Sa 25. Apr 2009, 11:16
- Kontaktdaten:
- Status: Offline
#7 RE: Unterschiedliche Variablen ?
Hi, set and get are synchronous calls, if you do set then following get will retrieve changed value.
On the other hand command sends a message to STATE, which means that new value will be only visible in next script execution.
Most of the objects created by use perform any set operations through the command API.
On the other hand command sends a message to STATE, which means that new value will be only visible in next script execution.
Most of the objects created by use perform any set operations through the command API.
Offizieller KNX Partner 