Sign in Join
Wiki copytemporary

If/fi: what changed

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

OldNewLine
1-`If` [[Keyword/fi|avainsana]] edeltää ehtoa jota seurattava `[[Then|then]]` ja lause (statement). Siinä voi olla myös `[[Else/fi|else]]` lause.
2-
3-
1+`If` [[Keyword/fi|avainsana]] edeltää ehtoa jota seurattava [[Then|then]] ja lause (statement). Siinä voi olla myös [[Else/fi|else]] lause.
42
53## `If then`
6-```
4+
5+``` pascal
76if condition
8- then true_statement
9- else false_statement;
7+ then true_statement
8+ else false_statement;
109```
1110
12-Yllä olevan `condition` on [[Boolean/fi|boolean]] tyyppinen ehto joka tuottaa [[True|true]] tai [[False|false]] arvon. Koodissa siirrytään `true_statement` jos `condition` tuottaa arvon `true`. Koodissa siirrytään `false_statement` suoritukseen jos `condition` tuottaa arvon `false`. Käännösaikainen virhe syntyy jos `condition` ei tuota `boolean` tyyppistä arvoa.
13-
14-
11+Yllä olevan `condition` on [[Boolean/fi|boolean]] tyyppinen ehto joka tuottaa [[True|true]] tai [[False|false]] arvon. Koodissa siirrytään `true_statement` jos `condition` tuottaa arvon `true`. Koodissa siirrytään `false_statement` suoritukseen jos `condition` tuottaa arvon `false`. Käännösaikainen virhe syntyy jos `condition` ei tuota `boolean` tyyppistä arvoa.
1512
1613### Monia lauseita `if then` haarassa
1714
18-Jos tarvitaan kahta tai useampaa lausetta `true_statement` tai `false_statement` niin se saadaan kokoamalla ne `[[Begin/fi|begin]] … [[End/fi|end]]` [[Block|lohkoon]] (koottu lause).
19-```
15+Jos tarvitaan kahta tai useampaa lausetta `true_statement` tai `false_statement` niin se saadaan kokoamalla ne [[Begin/fi|begin]]` … `[[End/fi|end]] [[Block|lohkoon]] (koottu lause).
16+
17+``` pascal
2018if boolean_condition then
21- begin
22- statement_zero;
23- statement_one;
24- statement_two;
25- end;
19+begin
20+ statement_zero;
21+ statement_one;
22+ statement_two;
23+end;
2624```
2725
28-
29-
3026## Katso myös
3127
32- * Official documentation: [Reference guide: § “The `If..then..else` statement”](<https://www.freepascal.org/docs-html/ref/refsu57.html>)
33- * [[Basic Pascal Tutorial/Chapter 3/IF|IF]], Tao Yue, Basic Pascal Introduction
34- * [[;/fi|If lause ja puolipiste]]
35-
36-
37-**Keywords:** [[Begin|begin]] — [[Do|do]] — [[Else|else]] — [[End|end]] — [[For|for]] — [[If|if]] — [[Repeat|repeat]] — [[Then|then]] — [[Until|until]] — [[While|while]]
28+- Official documentation: [Reference guide: § “The `If..then..else` statement”](https://www.freepascal.org/docs-html/ref/refsu57.html)
29+- [[Basic Pascal Tutorial/Chapter 3/IF|IF]], Tao Yue, Basic Pascal Introduction
30+- [[;/fi|If lause ja puolipiste]]
3831
3932---
40-*From the Free Pascal wiki, page "If/fi", as the Internet Archive kept it on 2025-03-22. 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).*
33+*From the Free Pascal wiki, page "If/fi", as it stood on 2023-01-25 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