Basic Pascal Tutorial/Chapter 5/Subranges
Sent here from Subranges.
English · Français · Български · 中文(中国) · 日本語
5B - Subranges (author: Tao Yue, state: unchanged)
A subrange type is defined in terms of another ordinal data type. The type specification is:
lowest_value .. highest_valuewhere lowest_value < highest_value and the two values are both in the range of another ordinal data type.
For example, you may want to declare the days of the week as well as the work week:
type
DaysOfWeek = (Sunday, Monday, Tuesday, Wednesday,
Thursday, Friday, Saturday);
DaysOfWorkWeek = Monday..Friday;You can also use subranges for built-in ordinal types such as char and integer.
From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 5/Subranges", 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.
Edited on wiki.freepascal.org by 7 people, 2007–2022
From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.
| When | Who | What changed |
|---|---|---|
| Kees | New page: 5B - Subranges A ''subrange'' type is defined in terms of another ordinal data type. The type specification is: lowest_value .. highest_value where <tt>lowest_value < highest_value</tt>... | |
| Kees | ||
| Kees | ||
| Kees | ||
| Vincent | Text replace - "delphi>" to "syntaxhighlight>" (minor) | |
| Jwdietrich | ||
| Swen | (minor) | |
| FTurtle | ||
| FTurtle | ||
| Trev | Fixed syntax highlighting (minor) | |
| Kai Burghardt | Kai Burghardt moved page Subranges to Basic Pascal Tutorial/Chapter 5/Subranges: tidy up main name space: create subpage hierarchy for basic Pascal tutorial [cf. [[Special: PermaLink/149778#Cluttering of... (minor) | |
| Kai Burghardt | bypass redirects [cf. discussion] | |
| Kai Burghardt | bypass language bar/categorization template redirect [cf. discussion] (minor) |
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
