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=2.0 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1ce0ce3b2db00698 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.228.227 with SMTP id sl3mr16851041pbc.5.1340719726484; Tue, 26 Jun 2012 07:08:46 -0700 (PDT) Path: l9ni22194pbj.0!nntp.google.com!news1.google.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: Re: how to print an array range? Date: Tue, 26 Jun 2012 09:08:44 -0500 Organization: Aioe.org NNTP Server Message-ID: References: <4fe9bf33$0$6566$9b4e6d93@newsspool4.arcor-online.net> Reply-To: nma@12000.org NNTP-Posting-Host: KdJUrTuvv3Zv/s8pPxNluw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-06-26T09:08:44-05:00 List-Id: On 6/26/2012 8:54 AM, Georg Bauhaus wrote: > On 26.06.12 15:47, Nasser M. Abbasi wrote: >> >> simple question from newbie. How do I print array range? > > A range is not a value of some type. > > For type T, print T'First and T'Last; for array A(..., ...), > print A'First(n) and A'Last(n), n > 0 being the nth index type. > Ok fair enough. btw, would you know by any chance why I get these values? ---------------------------------- with Ada.Text_Io; use Ada.Text_Io; with Ada.Float_Text_Io; use Ada.Float_Text_Io; with Ada.integer_Text_Io; use Ada.integer_Text_Io; with Ada.Numerics.Real_Arrays; use Ada.Numerics.Real_Arrays; procedure foo1 is A : constant Real_Matrix := (( 1.0, 2.0, 3.0), ( 4.0, 5.0, 6.0), ( 7.0, 8.0, 9.0)); begin put(A'First(1)); new_line; put(A'Last(1)); end foo1; ---------------------------- >gnatmake foo1.adb gcc-4.6 -c foo1.adb gnatbind -x foo1.ali gnatlink foo1.ali >./foo1 -2147483648 -2147483646 > I know I am doing something silly here. (I feel I have so much catching to do with Ada) --Nasser