comp.lang.ada
 help / color / mirror / Atom feed
From: Vamp4L <vampiro4l@gmail.com>
Subject: Ada code snippet help (array of arrays)
Date: Wed, 13 May 2009 07:11:17 -0700 (PDT)
Date: 2009-05-13T07:11:17-07:00	[thread overview]
Message-ID: <b6f7e019-522b-4eb8-9bb3-ae920d98a06d@n21g2000vba.googlegroups.com> (raw)

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;



             reply	other threads:[~2009-05-13 14:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13 14:11 Vamp4L [this message]
2009-05-13 14:25 ` Ada code snippet help (array of arrays) Georg Bauhaus
2009-05-13 14:28   ` Vamp4L
2009-05-13 15:05 ` Jacob Sparre Andersen
2009-05-14  8:05 ` Egil Høvik
2009-05-14 15:16   ` Adam Beneschan
2009-05-14 17:14     ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox