Sign in Join
Wiki copytemporary

Basic Pascal Tutorial/Chapter 3/WHILE..DO/ja: what changed

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

Title: Basic Pascal Tutorial/Chapter 3/WHILE..DO/ja

OldNewLine
1+## While ... DO loops
2+
3+3Db - WHILE..DO (著者: Tao Yue, 状態: 原文のまま修正なし)
4+
5+プリテスト・ループは以下の形式をとる。
6+
7+``` pascal
8+while ブール式 do
9+    文;
10+```
11+
12+ループはブール式が `FALSE` になるまで実行される。ループの中で用いられる変数の1つを変化させてブール式に影響を与えるようにしなくてはならない。さもないと無限ループという結果になってしまう。
13+
14+``` pascal
15+a := 5;
16+while a < 6 do
17+ writeln (a);
18+```
19+
20+変数の値を変化させることで、この状況を修正するとよい。
21+
22+``` pascal
23+a := 5;
24+while a < 6 do
25+begin
26+ writeln (a);
27+ a := a + 1
28+end;
29+```
30+
31+`WHILE ... DO` ループはプリテスト・ループと呼ばれる。条件がループが実行される前に調べられるからである。従って、条件が `FALSE` としてはじまってしまうと、ループはまったく実行されない。
32+
33+## 以下も参照のこと
34+
35+[[Basic Pascal Tutorial/Chapter 3/FOR..DO/ja|FOR ...DO loops]]
36+
37+[[Until/ja|Repeat... Until loops]]
38+
39+[[for-in loop/ja|For... in loops]]
40+
41+| | | |
42+|----|----|----|
43+| [[Basic Pascal Tutorial/Chapter 3/FOR..DO/ja|previous]] | [[Basic Pascal Tutorial/Contents/ja|contents]] | [[Basic Pascal Tutorial/Chapter 3/REPEAT..UNTIL/ja|next]] |
44+
45+---
46+*From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 3/WHILE..DO/ja", as it stood on 2022-08-20 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