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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,36cc6b79786b2ccc X-Google-Attributes: gid103376,public From: "Dr. Joachim Schr�er" Subject: Re: Ada question (defining types) Date: 2000/08/18 Message-ID: <8nj6b6$72a@newsserv.vs.dasa.de>#1/1 X-Deja-AN: 659694896 References: <8ngoog$f5e$1@news.uit.no> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Daimler-Benz Aerospace X-MSMail-Priority: Normal Newsgroups: comp.lang.ada Date: 2000-08-18T00:00:00+00:00 List-Id: Hello, a possible solution using a function could be as follows: --------------------------------------------- with ada.text_io; use ada.text_io; procedure testlongs is type integer_array is array(positive range <>) of integer; function The_integer_array(length : in positive; spacing : in integer) return integer_array is the : integer_array(1 .. length); begin for i in the'range loop the(i) := (i - 1) * spacing; end loop; return the; end The_integer_array; longs : constant integer_array := The_integer_array(length => 355/5+1, spacing => 5); begin for i in longs'range loop put(integer'image(longs(i))); end loop; end; ------------------------------------------------------------------ Reinert Korsnes schrieb in im Newsbeitrag: 8ngoog$f5e$1@news.uit.no... > Hi, I am still a bit new on Ada: > > Is it possible to make the following more compact and relyable > (less typo/error prone): > > > Longs : constant array ( Long_I ) of Integer := > ( 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, > 55, 60, 65, 70, 75, 80, 85, 90, 95, > 100,105,110,115,120,125,130,135,140,145,150, > 155,160,165,170,175,180,185,190,195, > 200,205,210,215,220,225,230,235,240,245,250, > 255,260,265,270,275,280,285,290,295, > 300,305,310,315,320,325,330,335,340,345,350,355); > > ? > > I believe this is a clumsy construct... > > reinert > > -- > Norwegian Polar Institute > Polar Environment Center > N-9296 Tromso > Norway > Fax: +47 77750501 > > http://geophys.npolar.no/~reinert/personal.html