Basic Pascal Tutorial/Chapter 5/Subranges/fr: 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/fr
| Old | New | Line | |
|---|---|---|---|
| 1 | + | [[Basic Pascal Tutorial/fr|Tutoriel de Pascal Objet]] : Types de données / **Intervalles** | |
| 2 | + | ||
| 3 | + | Un type *intervalle* est défini dans les termes d'un autre type de donnée ordinal. La spécification de type est : | |
| 4 | + | ||
| 5 | + | ``` pascal | |
| 6 | + | lowest_value .. highest_value | |
| 7 | + | ``` | |
| 8 | + | ||
| 9 | + | où `lowest_value < highest_value` et les deux valeurs sont dans la plage de l'autre type de donnée ordinal. | |
| 10 | + | ||
| 11 | + | Par exemple, vous voulez déclarer les jours de la semaine aussi bien que les jours travaillés : | |
| 12 | + | ||
| 13 | + | ``` pascal | |
| 14 | + | type | |
| 15 | + | DaysOfWeek = (Sunday, Monday, Tuesday, Wednesday, | |
| 16 | + | Thursday, Friday, Saturday); | |
| 17 | + | DaysOfWorkWeek = Monday..Friday; | |
| 18 | + | ``` | |
| 19 | + | ||
| 20 | + | Vous pouvez aussi utiliser les intervalles pour les types natifs tel que les `char` et `integer`. | |
| 21 | + | ||
| 22 | + | --- | |
| 23 | + | *From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 5/Subranges/fr", 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).* |
