comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
To: "lolo27" <limor_ru@walla.co.il>, <comp.lang.ada@ada-france.org>
Subject: Re: beginner array question
Date: Thu, 20 Nov 2003 06:03:53 -0600
Date: 2003-11-20T06:03:53-06:00	[thread overview]
Message-ID: <mailman.31.1069329852.3110.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: 92bfc3dd.0311200234.2b74b41f@posting.google.com

You need to do it like this:

function is_final(current_state:Something ;final:something_array) return boolean is
  begin
     for i in final'range loop
        if current_state = final (i) then
           return true;
        end if;
     end loop
     return false;
  end is_final;

----- Original Message ----- 
From: "lolo27" <limor_ru@walla.co.il>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada-france.org>
Sent: November 20, 2003 4:34 AM
Subject: beginner array question


> hi
> i am writing a generic package
> generic
>    ---------general parameters-----------
>    type Someting is(<>);
>    type something_array is Array (integer range<>) of Someting ;   
> 
> ---------------------------------------------------
> in the adb file i want to ask the following 
>  function is_final(current_state:Someting ;final:something_array ) return boolean is
>    begin
>       if current_state in final'First..final'Last then
>          return true;
>       else
>          return false;
>       end if;  
>    end is_final;
>    
>    ----
> 
> how can i ask if current_state is in final
> 
> thanks a lot
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada-france.org
> http://www.ada-france.org/mailman/listinfo/comp.lang.ada
> 
> 




  parent reply	other threads:[~2003-11-20 12:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-20 10:34 beginner array question lolo27
2003-11-20 12:00 ` Jeff C,
2003-11-20 12:03 ` David C. Hoos, Sr. [this message]
2003-11-20 17:40 ` Jeffrey Carter
replies disabled

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