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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!n21g2000vba.googlegroups.com!not-for-mail From: Vamp4L Newsgroups: comp.lang.ada Subject: Ada code snippet help (array of arrays) Date: Wed, 13 May 2009 07:11:17 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 137.244.215.61 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1242223877 3560 127.0.0.1 (13 May 2009 14:11:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 13 May 2009 14:11:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n21g2000vba.googlegroups.com; posting-host=137.244.215.61; posting-account=20TjLAoAAADWX1YT-nWqzU688bi5Fdxv User-Agent: G2/1.0 X-HTTP-Via: 1.1 RG78CS9238 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; InfoPath.2),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5810 Date: 2009-05-13T07:11:17-07:00 List-Id: 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 Put(Seat, 1); New_Line; end if; end loop; end Ch4Ex22;