comp.lang.ada
 help / color / mirror / Atom feed
* Re: boolean array
@ 2002-01-25  5:55 Christoph Grein
  2002-01-25 20:37 ` Robert Dewar
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Grein @ 2002-01-25  5:55 UTC (permalink / raw)


    Foo : array (some_range) of Boolean;
    ...
    Any_False_Present : constant Boolean := Foo /= (some_range => True);

But faster/preferred ??

> Hello,
> 
> I want to know if there is any false element(s) in an array of booleans.
> 
> Currently I am looping through the array and looking at each value until
> I find a false element.
> 
> x := true;
> for i in foo'range loop      -- foo'range < 8
>    x := foo (i);
>    exit when not x;
> end loop;
> 
> if x then .....
> 
> Is there a faster/preferred way of accomplishing this?
> I am compiling Ada 95 with Green Hills AdaMULTI for VxWorks running on x86.  
> 
> Thank you,
> Keith



^ permalink raw reply	[flat|nested] 4+ messages in thread
* boolean array
@ 2002-01-25  0:33 Keith
  2002-01-25 13:51 ` Sandro Binetti
  0 siblings, 1 reply; 4+ messages in thread
From: Keith @ 2002-01-25  0:33 UTC (permalink / raw)


Hello,

I want to know if there is any false element(s) in an array of booleans.

Currently I am looping through the array and looking at each value until
I find a false element.

x := true;
for i in foo'range loop      -- foo'range < 8
   x := foo (i);
   exit when not x;
end loop;

if x then .....

Is there a faster/preferred way of accomplishing this?
I am compiling Ada 95 with Green Hills AdaMULTI for VxWorks running on x86.  

Thank you,
Keith



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-01-25 20:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-25  5:55 boolean array Christoph Grein
2002-01-25 20:37 ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2002-01-25  0:33 Keith
2002-01-25 13:51 ` Sandro Binetti

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