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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8493c7e8c09c4895 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-20 04:00:23 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.mathworks.com!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!attbi_s03.POSTED!not-for-mail From: "Jeff C," Newsgroups: comp.lang.ada References: <92bfc3dd.0311200234.2b74b41f@posting.google.com> Subject: Re: beginner array question X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: NNTP-Posting-Host: 24.34.215.119 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s03 1069329622 24.34.215.119 (Thu, 20 Nov 2003 12:00:22 GMT) NNTP-Posting-Date: Thu, 20 Nov 2003 12:00:22 GMT Organization: Comcast Online Date: Thu, 20 Nov 2003 12:00:22 GMT Xref: archiver1.google.com comp.lang.ada:2721 Date: 2003-11-20T12:00:22+00:00 List-Id: "lolo27" 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.