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,453ed54f02292eea X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Simple Ada question Date: 2000/05/16 Message-ID: #1/1 X-Deja-AN: 624111163 Sender: bobduff@world.std.com (Robert A Duff) References: <8f8fm5$de5$1@news.uit.no> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 2000-05-16T00:00:00+00:00 List-Id: reinert@ola.npolar.no (Reinert Korsnes) writes: > n,I : Integer; >... > for I in 1 .. 10_000_000 loop > Why it says "I is never assigned a value" ? You have two different I's. The first one is never assigned a value, and not used in any way. The 'for' loop declares a new I, which hides the outer I. You're writing this the way you're supposed to do it in Pascal. In Ada, there's no need to declare the 'for' loop variable, because it's automatically declared. If you *do* declare a(nother) I, it will be a completely separate variable. If you reference the outer I after the loop, you're refering to an uninitialized variable. - Bob