comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Two Dimensional Array
Date: 15 Feb 2002 13:15:13 -0500
Date: 2002-02-15T18:19:57+00:00	[thread overview]
Message-ID: <ueljmobm6.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 3c6cf3db.11214605@news.demon.co.uk

brianc@billybob.demon.co.uk (Brian A Crawford) writes:

> I have a program to read  two numbers at a time from a file and then
> use a two dimensional array to look at that reference to see if a
> number 1 or 0 in assigned to the cell referenced.
> <snip>

Try this (I made the array smaller for simplicity):

with Ada.Text_IO; use Ada.Text_IO;
procedure Misc_Array_Aggregate
is
   subtype Firstevent is Integer range 1 .. 5;
   subtype Secondevent is Integer range 1 .. 5;
   type Two_Events_Type is array (Firstevent, Secondevent) of Integer;

   Event : Two_Events_Type :=
      (1      => (1 | 3 | 5 => 1, others => 0),
       2      => (2 | 4 => 1, others => 0),
       others => (others => 0));

begin
   Ada.Text_IO.Put_Line ("It works!");
end Misc_Array_Aggregate;

-- 
-- Stephe



  parent reply	other threads:[~2002-02-15 18:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-15 12:30 Two Dimensional Array Brian A Crawford
2002-02-15 17:28 ` Jeffrey Carter
2002-02-15 18:15 ` Stephen Leake [this message]
2002-02-15 22:50   ` Brian A Crawford
2002-02-16  2:05     ` Mike Silva
2002-02-16  9:38       ` Brian A Crawford
2002-02-23 13:36         ` Nick Roberts
replies disabled

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