Ankündigung

Einklappen
Keine Ankündigung bisher.

Retriggering variable change of a variable with same value

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    [Codebeispiel] Retriggering variable change of a variable with same value

    Hallo Zusammen.
    What's going on in the following sample, if i set a variable more times with the same value?

    1) Every time i push a KNX button, the "a" variable is set to EIN (the variable "a" is never reset to AUS)
    2) if a==EIN then ...do "HelloWorld".

    Does "HelloWorld" run every time i push the KNX button ?


    Danke für die Erklärung.
    Massimo

    #2
    Zitat von TheMax74 Beitrag anzeigen
    Does "HelloWorld" run every time i push the KNX button ?
    No, only if a will change.
    offizielles Supportforum für den Enertex® EibPC: https://knx-user-forum.de/eibpc/
    Enertex Produkte kaufen

    Kommentar


      #3
      try...

      [highlight=epc]
      if a==EIN then b=$Hello World$; a=AUS endif
      [/highlight]

      Gruß Martin
      Die Selbsthilfegruppe "UTF-8-Probleme" trifft sich diesmal abweichend im groüen Saal.

      Kommentar


        #4
        Thank you all.
        Brick, i cannot do this because i have later in my code:

        if delay(a, 5 minutes) and a==EIN then do "test"

        I cannot reset a == AUS immediately, otherwise after 5 minutes the "test" function will note be executed.

        Thank you anyway

        Kommentar


          #5
          and if you try:

          if delay(a, 5 minutes) and a==EIN then b="test"; a=AUS endif ?
          Die Selbsthilfegruppe "UTF-8-Probleme" trifft sich diesmal abweichend im groüen Saal.

          Kommentar


            #6
            Already done. :-)
            Thanks

            Kommentar


              #7
              Does event() work with variables or only GA? If yes I would do it with event()
              ....und versuchen Sie nicht erst anhand der Farbe der Stichflamme zu erkennen, was Sie falsch gemacht haben!

              Kommentar


                #8
                The "change()" function works with variable too, not the "event()"

                Kommentar

                Lädt...
                X