Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReGaHss: elseif() innerhalb while() #404

Closed
jm1536 opened this issue Sep 18, 2018 · 1 comment
Closed

ReGaHss: elseif() innerhalb while() #404

jm1536 opened this issue Sep 18, 2018 · 1 comment
Labels
🐛 bug-report Something isn't working 🏷️ ReGaHss This refs the ReGaHss component

Comments

@jm1536
Copy link

jm1536 commented Sep 18, 2018

Das elseif() funktioniert nicht innerhalb einer while() Schleife. Die Schleife wird nach dem 1. elseif abgebrochen. Ob auch foreach() betroffen ist, habe ich nicht überprüft.

Skript zum Nachstellen des Fehlers:

WriteLine("elseif funktioniert:");
integer i = 2;
WriteLine(i);
if     (i == 0) { WriteLine("i=0"); }
elseif (i == 1) { WriteLine("i=1"); }
elseif (i == 2) { WriteLine("i=2"); }
elseif (i == 3) { WriteLine("i=3"); }
else            { WriteLine("i=?"); }

WriteLine("elseif innerhalb while funktioniert nicht:");
integer i = 0;
while (i < 10) {
    WriteLine(i);
    if     (i == 0) { WriteLine("i=0"); }
    elseif (i == 1) { WriteLine("i=1"); }
    elseif (i == 2) { WriteLine("i=2"); }
    elseif (i == 3) { WriteLine("i=3"); }
    else            { WriteLine("i=?"); }
    i = i + 1;
}

WriteLine("end");

Ausgabe:

elseif funktioniert:
2
i=2
elseif innerhalb while funktioniert nicht:
0
i=0
1
i=1
end

Erwartete Ausgabe:

elseif funktioniert:
2
i=2
elseif innerhalb while funktioniert nicht:
0
i=0
1
i=1
2
i=2
3
i=3
4
i=?
...
9
i=?
end

  • Version [RaspberryMatic 2.35.16.20180826]
  • Hardware [RaspberryPi3B+, RPI-RF-MOD]
@jens-maus jens-maus changed the title Skriptprogrammierung: elseif() innerhalb while() ReGaHss: elseif() innerhalb while() Sep 19, 2018
@jens-maus jens-maus added 🏷️ ReGaHss This refs the ReGaHss component 🐛 bug-report Something isn't working labels Sep 19, 2018
@jens-maus jens-maus added this to the future release milestone Oct 27, 2018
jens-maus added a commit to jens-maus/occu-test that referenced this issue Oct 27, 2018
@jens-maus
Copy link
Owner

Please note that the automatic ReGaHss tests also show/demonstrate this issue:
https://travis-ci.org/hobbyquaker/occu-test/jobs/447049093#L1119

@jens-maus jens-maus modified the milestones: future release, next release Dec 6, 2018
eq-3-occu pushed a commit to eq-3/occu that referenced this issue Dec 12, 2018
  * fixed string backslash unescaping routines to correctly unescape
    double backslash uses and thus allow to define e.g. \t by using
    a "\\t" string which were not possible before.

2018-12-07 Jens Maus <mail@jens-maus.de>

  * implemented missing 'break' and 'continue' statements to break out
    of while() and foreach() loops and to also continue with the next
    iteration like this is commonly performed in other script languages.
    This refs jens-maus/RaspberryMatic#224

2018-12-06 Jens Maus <mail@jens-maus.de>

  * fixed bug where elseif() within a while/foreach() loop didn't work as
    expected but was quiting the loop too early.
    This fixes jens-maus/RaspberryMatic#404

2018-12-05 Jens Maus <mail@jens-maus.de>

  * fixed webserver to only create and reserve a session ID in case a
    successfull user login is performed (either manual or autologin). This
    should prevent from Denial-of-Service (DoS) situations where certain
    internal service could send multiple web requests to identify if
    a http server is running and thus could eat up all available session
    slots ending up in "Zu viele gleichzeitige Verbindungen" errors.

    NOTE: This change requires that the file /www/rega/index.htm will
          contain a small change so that "SessionId" is not a mandatory
          variable anymore.

2018-11-27 Jens Maus <mail@jens-maus.de>

  * fixed http response to manage more than 800kb of response payload so
    that the internal web server of ReGaHss can manage way larger http
    response data. This should finally allow to, e.g. serve larger
    system variables http displays at Settings -> Systemvariables with
    e.g. ~1k of system variables or with longer device list web pages.
eq-3-occu pushed a commit to eq-3/occu that referenced this issue Dec 12, 2018
  * fixed string backslash unescaping routines to correctly unescape
    double backslash uses and thus allow to define e.g. \t by using
    a "\\t" string which were not possible before.

2018-12-07 Jens Maus <mail@jens-maus.de>

  * implemented missing 'break' and 'continue' statements to break out
    of while() and foreach() loops and to also continue with the next
    iteration like this is commonly performed in other script languages.
    This refs jens-maus/RaspberryMatic#224

2018-12-06 Jens Maus <mail@jens-maus.de>

  * fixed bug where elseif() within a while/foreach() loop didn't work as
    expected but was quiting the loop too early.
    This fixes jens-maus/RaspberryMatic#404

2018-12-05 Jens Maus <mail@jens-maus.de>

  * fixed webserver to only create and reserve a session ID in case a
    successfull user login is performed (either manual or autologin). This
    should prevent from Denial-of-Service (DoS) situations where certain
    internal service could send multiple web requests to identify if
    a http server is running and thus could eat up all available session
    slots ending up in "Zu viele gleichzeitige Verbindungen" errors.

    NOTE: This change requires that the file /www/rega/index.htm will
          contain a small change so that "SessionId" is not a mandatory
          variable anymore.

2018-11-27 Jens Maus <mail@jens-maus.de>

  * fixed http response to manage more than 800kb of response payload so
    that the internal web server of ReGaHss can manage way larger http
    response data. This should finally allow to, e.g. serve larger
    system variables http displays at Settings -> Systemvariables with
    e.g. ~1k of system variables or with longer device list web pages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug-report Something isn't working 🏷️ ReGaHss This refs the ReGaHss component
Projects
Development

No branches or pull requests

2 participants