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...")
 
m (bypass language bar/categorization template redirect [cf. discussion])
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Subranges}}
+
{{Basic Pascal Tutorial/Chapter 5/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 lang=pascal>
 
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 lang=pascal>
<syntaxhighlight>
 
 
type
 
type
 
   DaysOfWeek = (Sunday, Monday, Tuesday, Wednesday,
 
   DaysOfWeek = (Sunday, Monday, Tuesday, Wednesday,
Line 18: Line 20:
 
</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"
|[[Enumerated_types/ja|previous]]   
+
|[[Basic Pascal Tutorial/Chapter 5/Enumerated types/ja|previous]]   
|[[Contents/ja|contents]]  
+
|[[Basic Pascal Tutorial/Contents/ja|contents]]  
|[[1-dimensional_arrays/ja|next]]
+
|[[Basic Pascal Tutorial/Chapter 5/1-dimensional arrays/ja|next]]
 
|}
 
|}

Latest revision as of 16:20, 20 August 2022

български (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