Sign in Join
Wiki copytemporary

Basic Pascal Tutorial/Chapter 5/Subranges/ja

English · Français · Български · 中文(中国) · 日本語

5B - 部分範囲型 (著者: Tao Yue, 状態: 原文のまま変更なし)

部分範囲 型は別な順序データ型で定義される。この型の指定は次の通りである。

pascal
lowest_value .. highest_value

ここで、 lowest_value < highest_value であり、2つの値はともに別な順序型の範囲に含まれている。

例えば、曜日を仕事日として宣言したいかもしれない。

pascal
type
  DaysOfWeek = (Sunday, Monday, Tuesday, Wednesday,
                Thursday, Friday, Saturday);
  DaysOfWorkWeek = Monday..Friday;

また、すでに組み込まれた char や integer のような順序型の範囲を利用することもできる。

previous contents next

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.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.