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,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,36208f5925ed5269 X-Google-Attributes: gid103376,public From: "Josh Highley" Subject: Re: non-consecutive ranges Date: 1999/05/03 Message-ID: <372da27f.0@silver.truman.edu>#1/1 X-Deja-AN: 473619236 References: <7gct90$7hr$1@nnrp1.dejanews.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 X-Complaints-To: abuse@more.net X-Trace: news.more.net 925759877 17833 150.243.160.9 (3 May 1999 19:31:17 GMT) Organization: MOREnet X-MSMail-Priority: Normal NNTP-Posting-Date: 3 May 1999 19:31:17 GMT Newsgroups: comp.lang.ada Date: 1999-05-03T19:31:17+00:00 List-Id: wrote in message news:7gct90$7hr$1@nnrp1.dejanews.com... > > > is there a way to define a variable to have a non-consecutive range? for > instance, let's say i wanted to define variable X with a range from 2 to 1024 > and 4096 to 8192. > > X : Integer range (1 .. 1024) and (4096 .. 8192); > > or something similar to this declaration. in addition to define > non-consecutive ranges, could i define a range of odd numbers? even numbers? > > how would i go about declaring this? > > joe How about this: X : integer range 2..8192; X_hole : integer range 1025..4096; ; other "holes" . . . . . . if an_integer not in X or else an_integer in X_hole then raise contraint_error; end if; . . . ; odd integers if (an_integer not in X) or else (an_integer mod 2 = 0) then raise constrain_error; end if; Josh Highley joshhighley@hotmail.com