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,2ac407a2a34565a9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.211.38 with SMTP id mz6mr9131521pbc.1.1330464795832; Tue, 28 Feb 2012 13:33:15 -0800 (PST) Path: h9ni20367pbe.0!nntp.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Array Help? Date: Tue, 28 Feb 2012 21:33:13 +0000 Organization: A noiseless patient Spider Message-ID: References: <10615783-d4a9-4cbd-8971-53ba1100d6a0@b18g2000vbz.googlegroups.com> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="31981"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WjmkigUxckpty4zL4S8t9PDxLTkEax5k=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:rci8C6a5E3h1FbsMpDof8OxSDDU= sha1:FbHFB+zdt/VDWaZbK/0wvASSThc= Content-Type: text/plain; charset=us-ascii Date: 2012-02-28T21:33:13+00:00 List-Id: Will writes: > Hello all, > > I am looking for your help again. I know how to refer to a certain > index in an array. for example if some array A is (53,83,3,62,3,13) > then A(4) = 62 but what if I wanted to go through an array and > identify certain indexes by what they contain? In my particular case > I need to identify the indexes that have numbers in them that do not > end in 1 or 2. These numbers range from 1 to 4 digits. Any ideas on > how I can do this? I presume A is an array of Integer, and that you're interested in the decimal representation (remember, modern computers run in binary so in a very real sense numbers have to "end in" 0 or 1!) for J in A'Range loop declare Decimal_Units : constant Natural := abs (A (J) mod 10); begin if Decimal_Units /= 1 and Decimal_Units /= 2 then -- A (J) doesn't end in 1 or 2. end if; end; end loop;