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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1c1a139977eee854 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-22 09:58:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!news-xfer.siscom.net!not-for-mail Message-ID: <3CC44130.6472A3C8@yahoo.com> Date: Mon, 22 Apr 2002 11:58:24 -0500 From: Anatoly Chernyshev X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Case statement and Integers. References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Original-NNTP-Posting-Host: 147.126.101.90 X-Original-Trace: 22 Apr 2002 10:59:28 -0700, 147.126.101.90 X-COMPLAINTS: Report abuse to abuse@mhogaming.com Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com NNTP-Posting-Host: 7ee7ef1b.news.newshosting.com X-Trace: DXC=\NI6Lil[AnRc\RlSDk66V]X`1N4>^k1LSiF6BbIV4YYRmfkIQ\;j:O\4O6[U:MlDBYM;lF[5C2PfXo5dZhTdOGR]oh3?Aa9Y?3R X-Complaints-To: abuse@newshosting.com Xref: archiver1.google.com comp.lang.ada:22923 Date: 2002-04-22T11:58:24-05:00 List-Id: Well, he was probably trying to say approximately the following: -------This is the compilable and working example--------------------- with text_io; use text_io; procedure af is numbers: array (1..100) of integer; pivot:constant integer:=30; begin for j in 1..100 loop numbers(j):=j; case Numbers(J) is when 1..Pivot - 1 => put_line (integer'image (j) & " is smaller than " & integer'image(pivot)); when Pivot + 1 .. 100 => put_line (integer'image (j) & " is larger than " & integer'image(pivot)); when others => put_line (integer'image (j) & " is equal to " & integer'image(pivot)); end case; end loop; end af; --------------------------------------------------------------------------------------------------- "Grein, Christoph" wrote: > > Sorry, this is my mistake. The correct expamle: > > > > case Numbers (J) is > > when Numbers_Array_Element_Type'First .. Pivot - 1 => > > ... > > when Pivot + 1 .. Numbers_Array_Element_Type'Last => > > ... > > when others => > > null; > > end case; > > > > and, Pivot must be constant. > > No, it must be static! Non-static choices are allowed only if there is just one > choice with this value (except for an additional others choice).