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,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no 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-20 12:17:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!deine.net!freenix!enst!enst.fr!not-for-mail From: "Vadim Godunko" Newsgroups: comp.lang.ada Subject: Re: Case statement and Integers. Date: Sat, 20 Apr 2002 23:14:13 +0400 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1019330222 63151 137.194.161.2 (20 Apr 2002 19:17:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sat, 20 Apr 2002 19:17:02 +0000 (UTC) Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.8 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:22830 Date: 2002-04-20T23:14:13+04:00 case Numbers(J) is when Numbers (J) in Numbers_Array_Element_Type'First .. Pivot - 1 => swap ... when Numbers (J) in Pivot + 1 .. Numbers_Array_Element_Type'Last => swap ... when others => null; end case; ----- Original Message ----- From: "Wannabe h4x0r" Newsgroups: comp.lang.ada Sent: Saturday, April 20, 2002 8:42 PM Subject: Case statement and Integers. > I have a statement like this... > > case numbers(j) is > when numbers(j) < pivot => swap(left_swap, right_swap); > -- If the number is less than the pivot, swap it with the number > -- to the right of the Pivot; > when numbers(j) > pivot => swap(right_swap, left_swap); > -- If the number is greater than the pivot, then do the opposite of the > -- above. > when numbers(j) = pivot => null; > when others => null; > end case; > > Now, it's pretty obvious whats wrong here. The swap procedure is > expecting an Integer, and instead it's getting a boolean value due to the > '>', '<', and '=>' operators. > > Whats the proper way to indicate to the compiler that I want to send > the numbers indexed by "left_swap" and "right_swap" to the swap procedure > rather than the results of the boolean test in the case statement? > > Thanks for your patience. > > Chris