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-Thread: a07f3367d7,994623ba34b222de X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 13 May 2009 16:25:26 +0200 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada code snippet help (array of arrays) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4a0ad856$0$31874$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 13 May 2009 16:25:26 CEST NNTP-Posting-Host: 78de933d.newsspool3.arcor-online.net X-Trace: DXC=Vid`i`LCi1SFm0Y?OE@2^XMcF=Q^Z^V3X4Fo<]lROoRQ^YC2XCjHcbYhDYha2KL_]\;9OJDO8_SKVNSZ1n^B98iZaXoJ[Hn?JnW X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:5812 Date: 2009-05-13T16:25:26+02:00 List-Id: Vamp4L schrieb: > Trying to figure out why my code doesn't work > This line in particular doesn't compile "if Theater(Seat)(reserved) = > F then" : > > with Ada.Text_Io; use Ada.Text_Io; > procedure Ch4Ex22 is > package Int_Io is new Integer_Io(Integer); > use Int_Io; > package Boolean_Io is new Enumeration_Io(Boolean); > use Boolean_Io; > > T: constant Boolean := True; > F: constant Boolean := False; > type Seatattributes is (Reserved, Balcony); > type SeatType is array(SeatAttributes) of Boolean; > type Theater is array (1..50) of SeatType; > A: Theater := (1=>(T,F),2..7=>(F,F),8=>(T,F),9..15=>(F,F),16=> > (T,F), > 17..23=>(F,F),24=>(T,F),25..29=>(F,F),30..31=>(F,T),32=>(T,T), > 33..49=>(F,T),50=>(T,T)); > > begin > > for Seat in Theater'range loop > if Theater(Seat)(reserved) = F then "Theater" is the name of a type. I guess you meant the array object A? > Put(Seat, 1); New_Line; > end if; > end loop; > > end Ch4Ex22; -- -- Georg Bauhaus Y A Time Drain http://www.9toX.de