Difference between revisions of "Basic Pascal Tutorial/Chapter 5/Subranges/ja"

From Free Pascal wiki
Jump to navigationJump to search
(Created page with "{{Subranges}} 5B - Subranges (author: Tao Yue, state: unchanged) A ''subrange'' type is defined in terms of another ordinal data type. The type specification is: <syntaxhigh...")
 
Line 1: Line 1:
 
{{Subranges}}
 
{{Subranges}}
  
5B - Subranges (author: Tao Yue, state: unchanged)
+
5B - 部分範囲型 (著者: Tao Yue, 状態: 原文のまま変更なし)
  
A ''subrange'' type is defined in terms of another ordinal data type. The type specification is:
+
''部分範囲'' 型は別な順序データ型で定義される。この型の指定は次の通りである。
 
<syntaxhighlight>
 
<syntaxhighlight>
 
lowest_value .. highest_value
 
lowest_value .. highest_value
 
</syntaxhighlight>
 
</syntaxhighlight>
  
where <tt>lowest_value < highest_value</tt> and the two values are both in the range of another ordinal data type.
+
ここで、 <tt>lowest_value < highest_value</tt> であり、2つの値はともに別な順序型の範囲に含まれている。
  
For example, you may want to declare the days of the week as well as the work week:
+
例えば、曜日を仕事日として宣言したいかもしれない。
 
<syntaxhighlight>
 
<syntaxhighlight>
 
type
 
type
Line 18: Line 18:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
You can also use subranges for built-in ordinal types such as <tt>char</tt> and <tt>integer</tt>.
+
また、すでに組み込まれた <tt>char</tt> <tt>integer</tt> のような順序型の範囲を利用したいこともあるだろう。
  
 
{|style=color-backgroud="white" cellspacing="20"
 
{|style=color-backgroud="white" cellspacing="20"

Revision as of 04:36, 19 September 2015

български (bg) English (en) français (fr) 日本語 (ja) 中文(中国大陆)‎ (zh_CN)

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

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

lowest_value .. highest_value

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

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

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

また、すでに組み込まれた charinteger のような順序型の範囲を利用したいこともあるだろう。

previous contents next