comp.lang.ada
 help / color / mirror / Atom feed
* Ada code snippet help (array of arrays)
@ 2009-05-13 14:11 Vamp4L
  2009-05-13 14:25 ` Georg Bauhaus
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Vamp4L @ 2009-05-13 14:11 UTC (permalink / 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;



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-05-14 17:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-13 14:11 Ada code snippet help (array of arrays) Vamp4L
2009-05-13 14:25 ` 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

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