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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7bbb352cbf633c73 X-Google-Attributes: gid103376,public From: dweller@dfw.net (David Weller) Subject: Re: Help with Text_IO Instantiation! Date: 1996/04/24 Message-ID: <4lls8g$5vb@dfw.dfw.net>#1/1 X-Deja-AN: 151682213 references: <4lc67p$jeh@hatathli.csulb.edu> <4llqlg$i49@newsbf02.news.aol.com> organization: DFWNet -- Public Internet Access newsgroups: comp.lang.ada Date: 1996-04-24T00:00:00+00:00 List-Id: In article <4llqlg$i49@newsbf02.news.aol.com>, John Herro wrote: >rgelb@csulb.edu (Robert Gelb) wrote: >> type string is array(integer range 1..10) of character; >> type SaType is array(integer range <>) of string; >> StrArray:SaType(1..5); >> begin >> put(StrArray(1));. >> What kind of Text_IO instatiation do I need to >> make 'put(StrArray(1));' work? [Good advice from John trimmed...] >ever, want to define your own string type. *Subtypes* of the built-in >type String are perfectly OK, and, since subtypes do not create a new >type, Ada.Text_IO works fine for them. > I hope this helps, and I hope it clears up more confusion than it >causes! >- John Herro >Software Innovations Technology >http://members.aol.com/AdaTutor >ftp://members.aol.com/AdaTutor What John means, of course, is that you want to probably do something like this: procedure sub is subtype Tiny_String is String(1..12); type Tiny_Array is array(integer range <>) of Tiny_String; TA : Tiny_Array(1..10); begin TA(1) := "Ohmygoodness"; put_Line(Ta(1)); end sub; Note that you could not simply declare: type Tiny_Array is array(String) of Tiny_String; Because String is an unconstrained array. -- Visit the Ada 95 Booch Components Homepage: www.ocsystems.com/booch This is not your father's Ada -- lglwww.epfl.ch/Ada