Sign in Join
Wiki copytemporary

Basic Pascal Tutorial/Chapter 5/Subranges/ja: what changed

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

Title: Basic Pascal Tutorial/Chapter 5/Subranges/ja

OldNewLine
1+5B - 部分範囲型 (著者: Tao Yue, 状態: 原文のまま変更なし)
2+
3+*部分範囲* 型は別な順序データ型で定義される。この型の指定は次の通りである。
4+
5+``` pascal
6+lowest_value .. highest_value
7+```
8+
9+ここで、 `lowest_value < highest_value` であり、2つの値はともに別な順序型の範囲に含まれている。
10+
11+例えば、曜日を仕事日として宣言したいかもしれない。
12+
13+``` pascal
14+type
15+ DaysOfWeek = (Sunday, Monday, Tuesday, Wednesday,
16+ Thursday, Friday, Saturday);
17+ DaysOfWorkWeek = Monday..Friday;
18+```
19+
20+また、すでに組み込まれた `char` や `integer` のような順序型の範囲を利用することもできる。
21+
22+| | | |
23+|----|----|----|
24+| [[Basic Pascal Tutorial/Chapter 5/Enumerated types/ja|previous]] | [[Basic Pascal Tutorial/Contents/ja|contents]] | [[Basic Pascal Tutorial/Chapter 5/1-dimensional arrays/ja|next]] |
25+
26+---
27+*From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 5/Subranges/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