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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,989d0c2f2f87320d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-09 14:30:49 PST Path: supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-hog.berkeley.edu!ucberkeley!newsfeed.stanford.edu!feed.textport.net!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Record type with check? Date: 09 Jan 2001 17:12:01 -0500 Organization: NASA Goddard Space Flight Center Message-ID: References: <868zolm9dp.fsf@book.mteege.de> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 979079072 27645 128.183.220.71 (9 Jan 2001 22:24:32 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 9 Jan 2001 22:24:32 GMT User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.6 Xref: supernews.google.com comp.lang.ada:3840 Date: 2001-01-09T22:24:32+00:00 List-Id: Matthias Teege writes: > Moin, > > ist there any way to build a record type like this: > > type Datum is > record > Var_A : Integer; > Var_B : Integer; > end record; > > which guarantees that Var_B is bigger than Var_A? This sounds like a homework problem, so I'll only give hints. If it's not homework, please reply with more info on why you need this. You cannot simply declare a type that has this property. But you can write a package that declares an abstract data type that does enforce this property. It must have a Create procedure that checks that A < B, and access procedures that let clients access A and B. -- -- Stephe