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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7d8ad14b2bbc7921 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-23 00:43:00 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!attbi_s03.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: unconstrained array question References: <4948f537.0311222312.43d843c5@posting.google.com> X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 24.6.135.22 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s03 1069576979 24.6.135.22 (Sun, 23 Nov 2003 08:42:59 GMT) NNTP-Posting-Date: Sun, 23 Nov 2003 08:42:59 GMT Organization: Comcast Online Date: Sun, 23 Nov 2003 08:42:59 GMT Xref: archiver1.google.com comp.lang.ada:2868 Date: 2003-11-23T08:42:59+00:00 List-Id: >type Arr is Array(Integer range<>) of Character; >Input_Line : String (1..256); So Input_Line is of type String, and Arr is a different type. > n:=new Arr'(Input_Line); "Arr'()" says "the thing inside the parens is of type Arr". But in fact the thing inside the parens is not an Arr, but is a String. So the compiler quite rightly points out that it expected something of type Arr. Perhaps what you want is subtype Arr is String; which, since there are no special constraints, would in effect mean that "Arr" is a synonym for "String". Of course even easier is just to forget about "Arr" entirely, and just use "String" where you now have "Arr". > Get_LIne(Input_Line,LAST); > n:=new Arr'(Input_Line); If you want "n" to point to just the data read, and not the whole 256 characters, you want n:=new Arr'(Input_Line(Input_Line'first .. LAST));