Sign in Join
Wiki copytemporary

Infinite loop/fi: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Infinite loop/fi

OldNewLine
1+Ikuinen silmukka (tunnetaan loppumattomana luuppina ) on luuppi joka ei koskaan pääty. Luupin sisällä olevia [[statement/fi|lauseita]] toistetaan ikuisesti.
2+
3+``` pascal
4+
5+ while true do
6+ begin
7+ end;
8+```
9+
10+``` pascal
11+
12+ repeat
13+ until false;
14+```
15+
16+## [[Break]] lause
17+
18+"[[While/fi|While]] [[True/fi|true]] [[Do/fi|do]]" tai "[[Repeat/fi|repeat]] [[Until/fi|until]] [[False/fi|false]]" luupit näyttävät aluksi ikuisilta silmukoilta mutta luupista poistutaan [[Break]] lauseella.
19+
20+``` pascal
21+
22+var
23+ i:integer;
24+begin
25+ i := 0;
26+ while true do
27+ begin
28+ i := i + 1;
29+ if i = 100 then break;
30+ end;
31+end;
32+```
33+
34+``` pascal
35+var
36+ i:integer;
37+begin
38+ i := 0;
39+ repeat
40+ i := i + 1;
41+ if i = 100 then break;
42+ until false;
43+end;
44+```
45+
46+## Katso myös
47+
48+- [[True/fi|true]]
49+- [[False/fi|false]]
50+- [[Repeat/fi|repeat]] [[Until/fi|until]]
51+- [[While/fi|while]] [[Do/fi|do]]
52+- [[Break/fi|break]]
53+
54+---
55+*From the Free Pascal wiki, page "Infinite loop/fi", as it stood on 2022-08-06 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history