comp.lang.ada
 help / color / mirror / Atom feed
From: "Rhoady" <rhoady@cox.rr.com>
Subject: Re: Case statement and Integers.
Date: Sat, 20 Apr 2002 17:04:09 GMT
Date: 2002-04-20T17:04:09+00:00	[thread overview]
Message-ID: <dchw8.69705$XP2.25184769@typhoon.southeast.rr.com> (raw)
In-Reply-To: YTgw8.79490$G72.56764@sccrnsc01

How about a nested IF like so:

  if Numbers(j) < Pivot then
    Swap (Left_Swap, Right_swap);
  elsif Numbers(j) < Pivot then
    Swap (Right_Swap, Left_Swap);
  else
    Null;
  end if;

This appears to be the 'guts' of a sort so I assume that this is inside a
for loop steping through the values of J.  And that J is being used to index
the array Numbers.  What I do not have a clue about is Pivot, Right_Swap and
Left_Swap.  Where are they set and to what values.

Jeff

"Wannabe h4x0r" <chris@dont.spam.me> wrote in message
news:YTgw8.79490$G72.56764@sccrnsc01...
> 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





  reply	other threads:[~2002-04-20 17:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-20 16:42 Case statement and Integers Wannabe h4x0r
2002-04-20 17:04 ` Rhoady [this message]
2002-04-20 17:11 ` Alan Reynolds
2002-04-20 17:32   ` Wannabe h4x0r
2002-04-20 18:31     ` tmoran
2002-04-21  3:59       ` Wannabe h4x0r
2002-04-22  3:01       ` Robert Dewar
2002-04-22  5:14       ` Anders Wirzenius
2002-04-20 21:26     ` Ted Dennison
2002-04-20 19:14 ` Vadim Godunko
2002-04-22  3:05   ` Robert Dewar
2002-04-22  8:41     ` Vadim Godunko
2002-04-22 13:16       ` Robert Dewar
2002-04-23  6:38     ` Wannabe h4x0r
2002-04-22 16:58 ` Anatoly Chernyshev
2002-04-22 17:55   ` tmoran
2002-04-22 19:51     ` Anatoly Chernyshev
2002-04-24 11:41   ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2002-04-22  9:11 Grein, Christoph
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox