comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeff C," <nolongersafeto@userealemailsniff.com>
Subject: Re: beginner array question
Date: Thu, 20 Nov 2003 12:00:22 GMT
Date: 2003-11-20T12:00:22+00:00	[thread overview]
Message-ID: <q12vb.255102$Tr4.800166@attbi_s03> (raw)
In-Reply-To: 92bfc3dd.0311200234.2b74b41f@posting.google.com


"lolo27" <limor_ru@walla.co.il> wrote in message
news:92bfc3dd.0311200234.2b74b41f@posting.google.com...
>  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

Not like this at all.. The "in" keyword is not an array search operator.
There is no single "search" this array for
a value keyword. You need to look through your array checking each value in
the array to see if it is
= to the current_state value. If you find it, return true. If you make it
out of the loop without finding it, return
false.

Since I am (perhaps incorrectly) assuming this is a homework related issue,
I did not post code..Hopefully (either way) the text based info is enough to
get you on the right track.





  reply	other threads:[~2003-11-20 12:00 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, [this message]
2003-11-20 12:03 ` David C. Hoos, Sr.
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