changed the while statement in the while-loop example#10843
Merged
oxzi merged 2 commits intoMay 12, 2026
Conversation
… 0), as the previous example didnt make much sense.
oxzi
approved these changes
May 12, 2026
Member
oxzi
left a comment
There was a problem hiding this comment.
$ icinga2 console
Icinga 2 (version: v2.16.0-16-gf50f6ec88)
Type $help to view available commands.
<1> => var num = 5
null
<2> =>
while (num > 5) {
log("Test")
num -= 1
}
null
<3> => num
5.000000
<4> =>
while (num > 0) {
log("Test")
num -= 1
}
information/config: Test
information/config: Test
information/config: Test
information/config: Test
information/config: Test
null
<5> => num
0.000000
Thanks!
oxzi
requested changes
May 12, 2026
Member
oxzi
left a comment
There was a problem hiding this comment.
Oops, please add yourself to the AUTHORS file as the failing CI job suggests. I somehow assumed you were already in there.
oxzi
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
...as the previous example didnt make much sense:
current:
new:
In the current example, the while loop would never do anything as
while (5 >5)is false, so no "Test" would be logged. Withwhile (num > 0)we will get 5 times "Test" in our log :)