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,e7d4f2a40929e50c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-22 02:17:14 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!irazu.switch.ch!switch.ch!news.hispeed.ch!not-for-mail From: Gautier Write-only Newsgroups: comp.lang.ada Subject: Re: array and pointers Date: Sat, 22 Nov 2003 11:16:47 +0100 Organization: Cablecom Newsserver Message-ID: <3FBF378F.FA7E5549@fakeaddress.nil> References: <4948f537.0311220139.570c8a4e@posting.google.com> NNTP-Posting-Host: dclient80-218-93-208.hispeed.ch Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: newshispeed.ch 1069496224 5301 80.218.93.208 (22 Nov 2003 10:17:04 GMT) X-Complaints-To: news@hispeed.ch NNTP-Posting-Date: Sat, 22 Nov 2003 10:17:04 +0000 (UTC) X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:2843 Date: 2003-11-22T11:16:47+01:00 List-Id: shoko: # what is wwrong in the following code?: # # type Arr is Array(Item range<>) of Integer; # a:Arr:=(1,2,2,2,3,4,3) ; # type n_array_Ptr is access Arr; # n: n_array_Ptr; # # begin # n:= new Array_filter(a); # # put_line("hello"); A good idea is to read what the compiler says. Here a test with GNAT: arrrrrrr.adb:9:14: "Array_filter" is undefined Okay, surely you meant "Arr" instead of "Array_filter". n:= new Arr(a); Let's try again: arrrrrrr.adb:9:17: if qualified expression was meant, use apostrophe arrrrrrr.adb:9:18: expect subtype mark for index constraint If you want to copy a into the new n.all you have to use apostrophe n:= new Arr'(a); HTH ________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/gsoft.htm NB: For a direct answer, e-mail address on the Web site!