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,8ca84a7c301c242,start X-Google-Attributes: gid103376,public From: William Paul Berriss Subject: GNAT for loop can't count! Date: 1997/07/28 Message-ID: <33DCBE03.27E8@reading.ac.uk>#1/1 X-Deja-AN: 259824709 Organization: The University of Reading Newsgroups: comp.lang.ada Date: 1997-07-28T00:00:00+00:00 List-Id: Hi I use GNAT Ada95 compiler v3.07 on a Sun SPARC 5 runnig Solaris 2.5. I have very simple for loop that should count upwards from 118 to 129 but it counts 118, ..., 126, 127, -128, -127 (i.e. changes to Negative after 127) Here is the loop: for P in Pixel(Firstp)..Pixel(Lastp) loop Ada.Integer_Text_IO.Put(Integer(P)); Ada.Text_IO.New_line; end loop; Where Pixel is Integer range 0..255 and Firstp and Lastp at this point are 118 and 129 respectively. Both of type Pixel. Very weird! Any advice or helpful ideas most welcome indeed!!!!!! Will Berriss ------------ -- W P Berriss E-mail: W.P.Berriss@reading.ac.uk Department of Engineering The University of Reading Whiteknights Reading Tel: 0118 987 5123 Berkshire (+44 118 987 5123 outside UK) RG6 6AY England Fax: 0118 931 3327 World Wide Web Home Page: http://www.elec.rdg.ac.uk/people/postgrads/will.html