comp.lang.ada
 help / color / mirror / Atom feed
* GNAT for loop can't count!
@ 1997-07-28  0:00 William Paul Berriss
  1997-07-28  0:00 ` Matthew Heaney
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: William Paul Berriss @ 1997-07-28  0:00 UTC (permalink / raw)



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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1997-07-29  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-07-28  0:00 GNAT for loop can't count! William Paul Berriss
1997-07-28  0:00 ` Matthew Heaney
1997-07-28  0:00 ` Robert Dewar
1997-07-29  0:00 ` Anonymous

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox