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-Thread: 103376,1ce0ce3b2db00698 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.50.186.228 with SMTP id fn4mr11348643igc.0.1340730310040; Tue, 26 Jun 2012 10:05:10 -0700 (PDT) Path: l9ni22669pbj.0!nntp.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "John B. Matthews" Newsgroups: comp.lang.ada Subject: Re: how to print an array range? Date: Tue, 26 Jun 2012 13:05:06 -0400 Organization: The Wasteland Message-ID: References: <4fe9bf33$0$6566$9b4e6d93@newsspool4.arcor-online.net> <4fe9daf1$0$6556$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: LQJtZWzu+iKlBROuDg+IUg.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: 2012-06-26T13:05:06-04:00 List-Id: In article , "Nasser M. Abbasi" wrote: > On 6/26/2012 10:53 AM, Georg Bauhaus wrote: > > On 26.06.12 16:24, Nasser M. Abbasi wrote: > >> But I wanted to see the range of > >> the first dimension of the Matrix A below. (1..3, 1..3) > > > > Specify the ranges you want, for example, > > > > A : constant Real_Matrix (1 .. 3, 1 .. 3) := > > (( 1.0, 2.0, 3.0), > > ( 4.0, 5.0, 6.0), > > ( 7.0, 8.0, 9.0)); > > > > I think I am not explaining myself well. > > I simply wanted to print the range itself, after > I define a variable. using PUT(). > > i.e. in the above, what would one write to > print "1..3" for A'range(1) and "1..3" for A'range(2)? > > I am not asking how to specify the range, I know that. > but to print it, for debugging purposes. > > I can't just type write put(A'range(1)). And when I write > put(A'first(1)) it prints -2147483648. > > Any way, no big deal, will figure it out. For debugging: Ada.Text_IO.Put_Line(A'First'Img & " " & A'Last'Img); Which also sheds light on your previous finding: B : Real_Matrix(A'Range(1), A'Range(2)); -- correct B : Real_Matrix(A'Range(1), Integer'First .. Integer'First + 2); -- John B. Matthews trashgod at gmail dot com