From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,25c89157223066bb X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Constraint error Date: 1999/04/07 Message-ID: #1/1 X-Deja-AN: 463722482 References: <370B9398.E10FC47F@rational.com> NNTP-Posting-Date: Wed, 07 Apr 1999 11:30:51 PDT Newsgroups: comp.lang.ada Date: 1999-04-07T00:00:00+00:00 List-Id: Nirmala Bhupathi writes: > I am getting a constraint error with this program. > Is it behaving right? Works OK for me. What value did you enter to get CE? Was it negative? (If so, then that would explain the error.) > with Ada.Text_IO; > with Interfaces; > > procedure Show is > > type Local_T is mod 32; > > type Alpha_T is new Local_T; > type Bravo_T is new Interfaces.Unsigned_32; > type Charlie_T is digits 6; > > package Alpha_IO is new Ada.Text_IO.Modular_IO(Alpha_T); > package Bravo_IO is new Ada.Text_IO.Modular_IO(Bravo_T); > package Charlie_IO is new Ada.Text_IO.Float_IO(Charlie_T); > > A : Alpha_T; > B : Bravo_T; > C : Charlie_T; > > begin > > Ada.Text_IO.Put ("Enter: "); > > Charlie_IO.Get(C); > > A := Alpha_T(C); > > Alpha_IO.Put(A); > > Ada.Text_IO.New_Line; > > B := Bravo_T(C); > > Bravo_IO.Put(B); > > Ada.Text_IO.New_Line; > > end Show;