comp.lang.ada
 help / color / mirror / Atom feed
From: jedivaughn <jedivaughn14@gmail.com>
Subject: Re: Array of Strings
Date: Wed, 24 Sep 2008 05:00:47 -0700 (PDT)
Date: 2008-09-24T05:00:47-07:00	[thread overview]
Message-ID: <5a8cb0df-b16a-45d0-a03e-146ebea83e4d@d77g2000hsb.googlegroups.com> (raw)
In-Reply-To: 2VaCk.356477$yE1.321489@attbi_s21

can anyone show me an example of using this to put string data into
the array and pulling it back out.

    generic

    type Element_Type is (<>); -- everything in the list is of this
type
    type range_array is (<>); -- the index of the array if of this
type

-- ads file of package
    package final is
      type recd is private;


      private
      type listy is array(range_array) of element_type;
      type recd is record
            str: listy;
            str_counter: integer;
            where: integer;
         end record;

   end final;



-- adb file of main program
   with ada.text_IO, ada.integer_text_IO, final;

    procedure List_package is
      subtype int_range is integer range 1..25;

       package list is new final (element_type=> character,
range_array => int_range);
       package list2 is new final (element_type => integer,
range_array => int_range);
      the : list.recd;
      the2 : list2.recd;
   begin


   end list_package;

every time I look for a place on how to do this they are using integer
data. so how do you do it with string data from a file?

Thanks,
John



  reply	other threads:[~2008-09-24 12:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-13 14:18 Array of Strings jedivaughn
2008-09-13 14:32 ` Ludovic Brenta
2008-09-14  0:11 ` anon
2008-09-14  9:45 ` Per Sandberg
2008-09-15 14:54 ` Adam Beneschan
2008-09-16 23:56   ` jedivaughn
2008-09-23 14:07     ` jedivaughn
2008-09-23 14:30       ` mockturtle
2008-09-23 14:41         ` Adam Beneschan
2008-09-23 14:47         ` Ludovic Brenta
2008-09-23 18:51       ` Jeffrey R. Carter
2008-09-24 12:00         ` jedivaughn [this message]
2008-09-24 14:36           ` Adam Beneschan
2008-09-24 15:13           ` John McCormick
2008-09-24 17:18           ` Jeffrey R. Carter
2008-09-28 12:24             ` jedivaughn
2008-09-28 13:01               ` mockturtle
2008-09-28 17:08                 ` jedivaughn
2008-09-29 11:14                   ` mockturtle
2008-09-28 19:00               ` Jeffrey R. Carter
2008-09-29 15:51                 ` Adam Beneschan
replies disabled

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