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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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:12:27 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!news.cambrium.nl!news.cambrium.nl!news.cambrium.nl!skynet.be!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada Subject: Re: beginner array question Date: Thu, 20 Nov 2003 06:03:53 -0600 Organization: Cuivre, Argent, Or Message-ID: References: <92bfc3dd.0311200234.2b74b41f@posting.google.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1069329853 87876 80.67.180.195 (20 Nov 2003 12:04:13 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 20 Nov 2003 12:04:13 +0000 (UTC) To: "lolo27" , Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.3 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:2722 Date: 2003-11-20T06:03:53-06:00 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" Newsgroups: comp.lang.ada To: 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 > >