Forum > Documentation (Maintaining -)

Unclear repeat-until docs

(1/3) > >>

Blaazen:
Hi, I noticed that text on this page is not very clear (but maybe it is my english).
https://wiki.freepascal.org/REPEAT..UNTIL

--- Quote ---Also, the loop continues until the Boolean expression is TRUE, whereas the while loop continues until the Boolean expression is FALSE.
--- End quote ---
This can be understood wrongly.  ;D

Endless loops are

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---repeatuntil False; while True do;

lucamar:
Sounds like a conundrum but if you think logically about it you'll see that the text is indeed right: repeat will keep looping until the condition (False) becomes True, whereas while will keep running until the condition (True) becomes False. Neither of which will ever pass (barring a "cosmic rays" incident ;)), so "infinite" loops.

Computer languages are funny like that :D

PascalDragon:

--- Quote from: Blaazen on November 19, 2020, 03:24:19 am ---Hi, I noticed that text on this page is not very clear (but maybe it is my english).
https://wiki.freepascal.org/REPEAT..UNTIL

--- Quote ---Also, the loop continues until the Boolean expression is TRUE, whereas the while loop continues until the Boolean expression is FALSE.
--- End quote ---
This can be understood wrongly.  ;D
--- End quote ---

In how far can this be understood wrongly?


--- Quote from: Blaazen on November 19, 2020, 03:24:19 am ---Endless loops are

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---repeatuntil False; while True do;
--- End quote ---

Yes, they are and they're supposed to be.

Zoran:

--- Quote from: Blaazen on November 19, 2020, 03:24:19 am ---Hi, I noticed that text on this page is not very clear (but maybe it is my english).
https://wiki.freepascal.org/REPEAT..UNTIL

--- Quote ---Also, the loop continues until the Boolean expression is TRUE, whereas the while loop continues until the Boolean expression is FALSE.
--- End quote ---
This can be understood wrongly.  ;D

--- End quote ---

I really cannot see anything confusing there. Quite clearly it says that:

Repeat-until loop continues while the expression is false and UNTIL it becomes true,
whereas
while loop continues WHILE the expression is true and until it becomes false.

Blaazen:
So it rather seems my english is not perfect.

--- Quote ---Also, the loop continues until the Boolean expression is TRUE = Also, the loop stops when the Boolean expression is TRUE
--- End quote ---
and

--- Quote ---while loop continues until the Boolean expression is FALSE =  while loop stops whenl the Boolean expression is FALSE
--- End quote ---
It was simply a little unclear to me.

Navigation

[0] Message Index

[#] Next page

Go to full version