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 X-Google-Attributes: gid103376,public From: nobody@REPLAY.COM (Anonymous) Subject: Re: GNAT for loop can't count! Date: 1997/07/29 Message-ID: <199707291328.PAA26376@basement.replay.com>#1/1 X-Deja-AN: 260157008 References: <33DCBE03.27E8@reading.ac.uk> Organization: Replay and Company UnLimited X-001: Replay may or may not approve of the content of this posting Mail-To-News-Contact: postmaster@nym.alias.net X-002: Report misuse of this automated service to X-URL: http://www.replay.com/remailer/ Newsgroups: comp.lang.ada Date: 1997-07-29T00:00:00+00:00 List-Id: On Mon, 28 Jul 1997 16:42:59 +0100, William Paul Berriss wrote: > 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. GNAT 3.07/Solaris/Sparc: with Ada.Text_Io; use Ada; procedure Junk is subtype Pixel is Integer range 0 .. 255; Firstp : Pixel; Lastp : Pixel; begin -- Junk Firstp := 118; Lastp := 129; Text_Io.Put_Line (Pixel'Image (Firstp) & Pixel'Image (Lastp) ); for P in Pixel (Firstp) .. Pixel (Lastp) loop Text_IO.Put_Line (Integer'Image (Integer (P) ) ); end loop; Text_Io.Skip_Line; for P in Firstp .. Lastp loop Text_Io.Put_Line (Pixel'Image (P) ); end loop; end Junk; Output: 118 129 118 119 120 121 122 124 125 126 127 129 118 119 120 121 122 123 124 125 126 127 128 129 Jeff Carter PGP:1024/440FBE21 My real e-mail address: ( carter @ innocon . com ) "Now go away or I shall taunt you a second time." Monty Python & the Holy Grail Posted with Spam Hater - see http://www.compulink.co.uk/~net-services/spam/