Sign in Join
Wiki copytemporary

Basic Pascal Tutorial/Chapter 5/Subranges/fr

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

Tutoriel de Pascal Objet : Types de données / Intervalles

Un type intervalle est défini dans les termes d'un autre type de donnée ordinal. La spécification de type est :

pascal
lowest_value .. highest_value

où lowest_value < highest_value et les deux valeurs sont dans la plage de l'autre type de donnée ordinal.

Par exemple, vous voulez déclarer les jours de la semaine aussi bien que les jours travaillés :

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

Vous pouvez aussi utiliser les intervalles pour les types natifs tel que les char et integer.


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.

Revision 1, last changed by WikiArchive .

Talk about this page

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