home *** CD-ROM | disk | FTP | other *** search
- -- Chapter 6 - Programming exercise 3
- with Text_IO;
- use Text_IO;
-
- procedure Ch07_3 is
-
- type MY_ENUM is (YES, NO, MAYBE, WHY, POSSIBLY);
-
- Answer : MY_ENUM := YES;
-
- begin
- Answer := MY_ENUM'PRED(Answer);
- end Ch07_3;
-
-
-
-
- -- Result of execution
-
- -- Exception never handled: constraint_error
- -- Value 0 out of range 1..4.
-
- -- (This means that since the range of the enumerated variable
- -- only covers four values, trying to assign the value of zero,
- -- which is one less than the allowed minimum causes us to go
- -- out of the allowable range. )
-
-
-