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,3ed9f245566db0d5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-16 05:03:17 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!129.240.148.23!uio.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Question on arrays Date: Mon, 16 Sep 2002 12:03:16 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: NNTP-Posting-Host: kiuk0156.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1032177796 20408 129.241.83.82 (16 Sep 2002 12:03:16 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Mon, 16 Sep 2002 12:03:16 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:29015 Date: 2002-09-16T12:03:16+00:00 List-Id: On 16 Sep 2002 04:02:44 -0700, prashna wrote: > Hi all, > Pls explain what is wrong in this statement? > > A_Integer(2) := (others => 2.0); ^^^ Isn't this a real and you have integers in the array. Does Tartan allow you to compile this? Anyway the problem with the statment above is that you are trying to put the composite type from (other => 2) into the array at the second element. Here you can only put a integer. I assume you have a simple array like: type A_Integer_Type is array (1..10) of Integer; A_Integer : A_Integer_Type; So please explain a bit more what you are trying to do here and also read: http://www.it.bton.ac.uk/staff/je/adacraft/ch06.htm and http://goanna.cs.rmit.edu.au/~dale/ada/aln/6_arrays.html An example program: procedure t is type A_Integer_Type is array (1..10) of integer; A_Integer : A_Integer_Type; begin -- Now I want to put the interger 5 in the array place 2 and 1 in all -- the others. A_Integer := (2 => 5, others => 1); end t; Preben